@@ -1681,14 +1681,13 @@ nop_list_lift! {substs; GenericArg<'a> => GenericArg<'tcx>}
16811681CloneLiftImpls ! { for <' tcx> { Constness , traits:: WellFormedLoc , } }
16821682
16831683pub mod tls {
1684- use super :: { ptr_eq , GlobalCtxt , TyCtxt } ;
1684+ use super :: { GlobalCtxt , TyCtxt } ;
16851685
16861686 use crate :: dep_graph:: TaskDepsRef ;
16871687 use crate :: ty:: query;
16881688 use rustc_data_structures:: sync:: { self , Lock } ;
16891689 use rustc_data_structures:: thin_vec:: ThinVec ;
16901690 use rustc_errors:: Diagnostic ;
1691- use std:: mem;
16921691
16931692 #[ cfg( not( parallel_compiler) ) ]
16941693 use std:: cell:: Cell ;
@@ -1814,23 +1813,6 @@ pub mod tls {
18141813 with_context_opt ( |opt_context| f ( opt_context. expect ( "no ImplicitCtxt stored in tls" ) ) )
18151814 }
18161815
1817- /// Allows access to the current `ImplicitCtxt` whose tcx field is the same as the tcx argument
1818- /// passed in. This means the closure is given an `ImplicitCtxt` with the same `'tcx` lifetime
1819- /// as the `TyCtxt` passed in.
1820- /// This will panic if you pass it a `TyCtxt` which is different from the current
1821- /// `ImplicitCtxt`'s `tcx` field.
1822- #[ inline]
1823- pub fn with_related_context < ' tcx , F , R > ( tcx : TyCtxt < ' tcx > , f : F ) -> R
1824- where
1825- F : FnOnce ( & ImplicitCtxt < ' _ , ' tcx > ) -> R ,
1826- {
1827- with_context ( |context| unsafe {
1828- assert ! ( ptr_eq( context. tcx. gcx, tcx. gcx) ) ;
1829- let context: & ImplicitCtxt < ' _ , ' _ > = mem:: transmute ( context) ;
1830- f ( context)
1831- } )
1832- }
1833-
18341816 /// Allows access to the `TyCtxt` in the current `ImplicitCtxt`.
18351817 /// Panics if there is no `ImplicitCtxt` available.
18361818 #[ inline]
@@ -2872,12 +2854,6 @@ impl<T, R, E> InternIteratorElement<T, R> for Result<T, E> {
28722854 }
28732855}
28742856
2875- // We are comparing types with different invariant lifetimes, so `ptr::eq`
2876- // won't work for us.
2877- fn ptr_eq < T , U > ( t : * const T , u : * const U ) -> bool {
2878- t as * const ( ) == u as * const ( )
2879- }
2880-
28812857pub fn provide ( providers : & mut ty:: query:: Providers ) {
28822858 providers. resolutions = |tcx, ( ) | & tcx. untracked_resolutions ;
28832859 providers. module_reexports =
0 commit comments