File tree 1 file changed +10
-1
lines changed
compiler/rustc_infer/src/infer/snapshot
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 {
96
96
}
97
97
98
98
#[ macro_export]
99
+ #[ cfg( debug_assertions) ]
99
100
macro_rules! type_foldable_verify_no_snapshot_leaks {
100
101
( $tcx: lifetime, $t: ty) => {
101
102
const _: ( ) = {
@@ -116,7 +117,7 @@ macro_rules! type_foldable_verify_no_snapshot_leaks {
116
117
( value, visitor)
117
118
}
118
119
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( ) {
120
121
bug!( "leaking vars from snapshot: {value:?}" ) ;
121
122
}
122
123
@@ -126,3 +127,11 @@ macro_rules! type_foldable_verify_no_snapshot_leaks {
126
127
} ;
127
128
} ;
128
129
}
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