@@ -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 , FnSigKind , GenericArg ,
7273 GenericArgs , GenericArgsRef , GenericParamDefKind , List , ListWithCachedTypeInfo , ParamConst ,
@@ -836,17 +837,22 @@ impl CurrentGcx {
836837}
837838
838839impl < ' tcx > TyCtxt < ' tcx > {
839- #[ inline]
840840 pub fn is_in_sandbox ( self ) -> bool {
841- self . is_in_sandbox . load ( std :: sync :: atomic :: Ordering :: Relaxed )
841+ self . is_in_sandbox . load ( AtomicOrdering :: Relaxed )
842842 }
843843
844844 pub fn with_sandbox ( self , op : impl FnOnce ( ) ) {
845- self . is_in_sandbox . store ( true , std:: sync:: atomic:: Ordering :: Relaxed ) ;
845+ self . is_in_sandbox . store ( true , AtomicOrdering :: Relaxed ) ;
846+ self . enter_query_sandbox ( ) ;
846847
847- op ( ) ;
848+ self . dep_graph . with_sandbox ( || {
849+ with_no_trimmed_paths ! ( {
850+ op( ) ;
851+ } ) ;
852+ } ) ;
848853
849- self . is_in_sandbox . store ( false , std:: sync:: atomic:: Ordering :: Relaxed ) ;
854+ self . leave_query_sandbox ( ) ;
855+ self . is_in_sandbox . store ( false , AtomicOrdering :: Relaxed ) ;
850856
851857 self . clauses_cache . borrow_mut ( ) . clear ( ) ;
852858 self . highest_var_in_clauses_cache . borrow_mut ( ) . clear ( ) ;
0 commit comments