@@ -1681,14 +1681,13 @@ nop_list_lift! {substs; GenericArg<'a> => GenericArg<'tcx>}
1681
1681
CloneLiftImpls ! { for <' tcx> { Constness , traits:: WellFormedLoc , } }
1682
1682
1683
1683
pub mod tls {
1684
- use super :: { ptr_eq , GlobalCtxt , TyCtxt } ;
1684
+ use super :: { GlobalCtxt , TyCtxt } ;
1685
1685
1686
1686
use crate :: dep_graph:: TaskDepsRef ;
1687
1687
use crate :: ty:: query;
1688
1688
use rustc_data_structures:: sync:: { self , Lock } ;
1689
1689
use rustc_data_structures:: thin_vec:: ThinVec ;
1690
1690
use rustc_errors:: Diagnostic ;
1691
- use std:: mem;
1692
1691
1693
1692
#[ cfg( not( parallel_compiler) ) ]
1694
1693
use std:: cell:: Cell ;
@@ -1814,23 +1813,6 @@ pub mod tls {
1814
1813
with_context_opt ( |opt_context| f ( opt_context. expect ( "no ImplicitCtxt stored in tls" ) ) )
1815
1814
}
1816
1815
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
-
1834
1816
/// Allows access to the `TyCtxt` in the current `ImplicitCtxt`.
1835
1817
/// Panics if there is no `ImplicitCtxt` available.
1836
1818
#[ inline]
@@ -2872,12 +2854,6 @@ impl<T, R, E> InternIteratorElement<T, R> for Result<T, E> {
2872
2854
}
2873
2855
}
2874
2856
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
-
2881
2857
pub fn provide ( providers : & mut ty:: query:: Providers ) {
2882
2858
providers. resolutions = |tcx, ( ) | & tcx. untracked_resolutions ;
2883
2859
providers. module_reexports =
0 commit comments