File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
compiler/rustc_infer/src/infer/snapshot Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,7 @@ impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for HasSnapshotLeaksVisitor {
9696}
9797
9898#[ macro_export]
99+ #[ cfg( debug_assertions) ]
99100macro_rules! type_foldable_verify_no_snapshot_leaks {
100101 ( $tcx: lifetime, $t: ty) => {
101102 const _: ( ) = {
@@ -116,7 +117,7 @@ macro_rules! type_foldable_verify_no_snapshot_leaks {
116117 ( value, visitor)
117118 }
118119 fn avoid_leaks( _: & InferCtxt <$tcx>, ( value, mut visitor) : Self :: EndData ) -> Self {
119- if cfg! ( debug_assertions ) && value. visit_with( & mut visitor) . is_break( ) {
120+ if value. visit_with( & mut visitor) . is_break( ) {
120121 bug!( "leaking vars from snapshot: {value:?}" ) ;
121122 }
122123
@@ -126,3 +127,11 @@ macro_rules! type_foldable_verify_no_snapshot_leaks {
126127 } ;
127128 } ;
128129}
130+
131+ #[ macro_export]
132+ #[ cfg( not( debug_assertions) ) ]
133+ macro_rules! type_foldable_verify_no_snapshot_leaks {
134+ ( $tcx: lifetime, $t: ty) => {
135+ trivial_no_snapshot_leaks!( $tcx, $t)
136+ } ;
137+ }
You can’t perform that action at this time.
0 commit comments