@@ -12,7 +12,7 @@ use std::ffi::OsStr;
1212use std:: hash:: { Hash , Hasher } ;
1313use std:: marker:: { PhantomData , PointeeSized } ;
1414use std:: ops:: { Bound , Deref } ;
15- use std:: sync:: atomic:: AtomicBool ;
15+ use std:: sync:: atomic:: { AtomicBool , Ordering as AtomicOrdering } ;
1616use std:: sync:: { Arc , OnceLock } ;
1717use std:: { fmt, iter, mem} ;
1818
@@ -67,6 +67,7 @@ use crate::thir::Thir;
6767use crate :: traits;
6868use crate :: traits:: solve:: { ExternalConstraints , ExternalConstraintsData , PredefinedOpaques } ;
6969use crate :: ty:: predicate:: ExistentialPredicateStableCmpExt as _;
70+ use crate :: ty:: print:: with_no_trimmed_paths;
7071use crate :: ty:: {
7172 self , AdtDef , AdtDefData , AdtKind , Binder , Clause , Clauses , Const , GenericArg , GenericArgs ,
7273 GenericArgsRef , GenericParamDefKind , List , ListWithCachedTypeInfo , ParamConst , Pattern ,
@@ -898,17 +899,22 @@ impl CurrentGcx {
898899}
899900
900901impl < ' tcx > TyCtxt < ' tcx > {
901- #[ inline]
902902 pub fn is_in_sandbox ( self ) -> bool {
903- self . is_in_sandbox . load ( std :: sync :: atomic :: Ordering :: Relaxed )
903+ self . is_in_sandbox . load ( AtomicOrdering :: Relaxed )
904904 }
905905
906906 pub fn with_sandbox ( self , op : impl FnOnce ( ) ) {
907- self . is_in_sandbox . store ( true , std:: sync:: atomic:: Ordering :: Relaxed ) ;
907+ self . is_in_sandbox . store ( true , AtomicOrdering :: Relaxed ) ;
908+ self . enter_query_sandbox ( ) ;
908909
909- op ( ) ;
910+ self . dep_graph . with_sandbox ( || {
911+ with_no_trimmed_paths ! ( {
912+ op( ) ;
913+ } ) ;
914+ } ) ;
910915
911- self . is_in_sandbox . store ( false , std:: sync:: atomic:: Ordering :: Relaxed ) ;
916+ self . leave_query_sandbox ( ) ;
917+ self . is_in_sandbox . store ( false , AtomicOrdering :: Relaxed ) ;
912918
913919 self . clauses_cache . borrow_mut ( ) . clear ( ) ;
914920 self . highest_var_in_clauses_cache . borrow_mut ( ) . clear ( ) ;
0 commit comments