@@ -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
@@ -69,6 +69,7 @@ use crate::thir::Thir;
6969use crate :: traits;
7070use crate :: traits:: solve:: { ExternalConstraints , ExternalConstraintsData , PredefinedOpaques } ;
7171use crate :: ty:: predicate:: ExistentialPredicateStableCmpExt as _;
72+ use crate :: ty:: print:: with_no_trimmed_paths;
7273use crate :: ty:: {
7374 self , AdtDef , AdtDefData , AdtKind , Binder , Clause , Clauses , Const , GenericArg , GenericArgs ,
7475 GenericArgsRef , GenericParamDefKind , List , ListWithCachedTypeInfo , ParamConst , Pattern ,
@@ -956,17 +957,22 @@ impl CurrentGcx {
956957}
957958
958959impl < ' tcx > TyCtxt < ' tcx > {
959- #[ inline]
960960 pub fn is_in_sandbox ( self ) -> bool {
961- self . is_in_sandbox . load ( std :: sync :: atomic :: Ordering :: Relaxed )
961+ self . is_in_sandbox . load ( AtomicOrdering :: Relaxed )
962962 }
963963
964964 pub fn with_sandbox ( self , op : impl FnOnce ( ) ) {
965- self . is_in_sandbox . store ( true , std:: sync:: atomic:: Ordering :: Relaxed ) ;
965+ self . is_in_sandbox . store ( true , AtomicOrdering :: Relaxed ) ;
966+ self . enter_query_sandbox ( ) ;
966967
967- op ( ) ;
968+ self . dep_graph . with_sandbox ( || {
969+ with_no_trimmed_paths ! ( {
970+ op( ) ;
971+ } ) ;
972+ } ) ;
968973
969- self . is_in_sandbox . store ( false , std:: sync:: atomic:: Ordering :: Relaxed ) ;
974+ self . leave_query_sandbox ( ) ;
975+ self . is_in_sandbox . store ( false , AtomicOrdering :: Relaxed ) ;
970976
971977 self . clauses_cache . borrow_mut ( ) . clear ( ) ;
972978 self . highest_var_in_clauses_cache . borrow_mut ( ) . clear ( ) ;
0 commit comments