@@ -1684,14 +1684,13 @@ nop_list_lift! {substs; GenericArg<'a> => GenericArg<'tcx>}
1684
1684
CloneLiftImpls ! { for <' tcx> { Constness , traits:: WellFormedLoc , } }
1685
1685
1686
1686
pub mod tls {
1687
- use super :: { ptr_eq , GlobalCtxt , TyCtxt } ;
1687
+ use super :: { GlobalCtxt , TyCtxt } ;
1688
1688
1689
1689
use crate :: dep_graph:: { DepKind , TaskDeps } ;
1690
1690
use crate :: ty:: query;
1691
1691
use rustc_data_structures:: sync:: { self , Lock } ;
1692
1692
use rustc_data_structures:: thin_vec:: ThinVec ;
1693
1693
use rustc_errors:: Diagnostic ;
1694
- use std:: mem;
1695
1694
1696
1695
#[ cfg( not( parallel_compiler) ) ]
1697
1696
use std:: cell:: Cell ;
@@ -1811,23 +1810,6 @@ pub mod tls {
1811
1810
with_context_opt ( |opt_context| f ( opt_context. expect ( "no ImplicitCtxt stored in tls" ) ) )
1812
1811
}
1813
1812
1814
- /// Allows access to the current `ImplicitCtxt` whose tcx field is the same as the tcx argument
1815
- /// passed in. This means the closure is given an `ImplicitCtxt` with the same `'tcx` lifetime
1816
- /// as the `TyCtxt` passed in.
1817
- /// This will panic if you pass it a `TyCtxt` which is different from the current
1818
- /// `ImplicitCtxt`'s `tcx` field.
1819
- #[ inline]
1820
- pub fn with_related_context < ' tcx , F , R > ( tcx : TyCtxt < ' tcx > , f : F ) -> R
1821
- where
1822
- F : FnOnce ( & ImplicitCtxt < ' _ , ' tcx > ) -> R ,
1823
- {
1824
- with_context ( |context| unsafe {
1825
- assert ! ( ptr_eq( context. tcx. gcx, tcx. gcx) ) ;
1826
- let context: & ImplicitCtxt < ' _ , ' _ > = mem:: transmute ( context) ;
1827
- f ( context)
1828
- } )
1829
- }
1830
-
1831
1813
/// Allows access to the `TyCtxt` in the current `ImplicitCtxt`.
1832
1814
/// Panics if there is no `ImplicitCtxt` available.
1833
1815
#[ inline]
@@ -2834,12 +2816,6 @@ impl<T, R, E> InternIteratorElement<T, R> for Result<T, E> {
2834
2816
}
2835
2817
}
2836
2818
2837
- // We are comparing types with different invariant lifetimes, so `ptr::eq`
2838
- // won't work for us.
2839
- fn ptr_eq < T , U > ( t : * const T , u : * const U ) -> bool {
2840
- t as * const ( ) == u as * const ( )
2841
- }
2842
-
2843
2819
pub fn provide ( providers : & mut ty:: query:: Providers ) {
2844
2820
providers. in_scope_traits_map =
2845
2821
|tcx, id| tcx. hir_crate ( ( ) ) . owners [ id] . as_ref ( ) . map ( |owner_info| & owner_info. trait_map ) ;
0 commit comments