@@ -146,7 +146,7 @@ impl<'tcx> Stack {
146
146
/// Panics if any of the caching mechanisms have broken,
147
147
/// - The StackCache indices don't refer to the parallel items,
148
148
/// - There are no Unique items outside of first_unique..last_unique
149
- #[ cfg( all ( feature = "stack-cache" , debug_assertions ) ) ]
149
+ #[ cfg( feature = "stack-cache-consistency-check" ) ]
150
150
fn verify_cache_consistency ( & self ) {
151
151
// Only a full cache needs to be valid. Also see the comments in find_granting_cache
152
152
// and set_unknown_bottom.
@@ -190,7 +190,7 @@ impl<'tcx> Stack {
190
190
tag : ProvenanceExtra ,
191
191
exposed_tags : & FxHashSet < BorTag > ,
192
192
) -> Result < Option < usize > , ( ) > {
193
- #[ cfg( all ( feature = "stack-cache" , debug_assertions ) ) ]
193
+ #[ cfg( feature = "stack-cache-consistency-check" ) ]
194
194
self . verify_cache_consistency ( ) ;
195
195
196
196
let ProvenanceExtra :: Concrete ( tag) = tag else {
@@ -327,7 +327,7 @@ impl<'tcx> Stack {
327
327
// This primes the cache for the next access, which is almost always the just-added tag.
328
328
self . cache . add ( new_idx, new) ;
329
329
330
- #[ cfg( debug_assertions ) ]
330
+ #[ cfg( feature = "stack-cache-consistency-check" ) ]
331
331
self . verify_cache_consistency ( ) ;
332
332
}
333
333
@@ -410,7 +410,7 @@ impl<'tcx> Stack {
410
410
self . unique_range . end = self . unique_range . end . min ( disable_start) ;
411
411
}
412
412
413
- #[ cfg( all ( feature = "stack-cache" , debug_assertions ) ) ]
413
+ #[ cfg( feature = "stack-cache-consistency-check" ) ]
414
414
self . verify_cache_consistency ( ) ;
415
415
416
416
Ok ( ( ) )
@@ -465,7 +465,7 @@ impl<'tcx> Stack {
465
465
self . unique_range = 0 ..0 ;
466
466
}
467
467
468
- #[ cfg( all ( feature = "stack-cache" , debug_assertions ) ) ]
468
+ #[ cfg( feature = "stack-cache-consistency-check" ) ]
469
469
self . verify_cache_consistency ( ) ;
470
470
Ok ( ( ) )
471
471
}
0 commit comments