@@ -146,7 +146,7 @@ impl<'tcx> Stack {
146146 /// Panics if any of the caching mechanisms have broken,
147147 /// - The StackCache indices don't refer to the parallel items,
148148 /// - 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" ) ]
150150 fn verify_cache_consistency ( & self ) {
151151 // Only a full cache needs to be valid. Also see the comments in find_granting_cache
152152 // and set_unknown_bottom.
@@ -190,7 +190,7 @@ impl<'tcx> Stack {
190190 tag : ProvenanceExtra ,
191191 exposed_tags : & FxHashSet < BorTag > ,
192192 ) -> Result < Option < usize > , ( ) > {
193- #[ cfg( all ( feature = "stack-cache" , debug_assertions ) ) ]
193+ #[ cfg( feature = "stack-cache-consistency-check" ) ]
194194 self . verify_cache_consistency ( ) ;
195195
196196 let ProvenanceExtra :: Concrete ( tag) = tag else {
@@ -327,7 +327,7 @@ impl<'tcx> Stack {
327327 // This primes the cache for the next access, which is almost always the just-added tag.
328328 self . cache . add ( new_idx, new) ;
329329
330- #[ cfg( debug_assertions ) ]
330+ #[ cfg( feature = "stack-cache-consistency-check" ) ]
331331 self . verify_cache_consistency ( ) ;
332332 }
333333
@@ -410,7 +410,7 @@ impl<'tcx> Stack {
410410 self . unique_range . end = self . unique_range . end . min ( disable_start) ;
411411 }
412412
413- #[ cfg( all ( feature = "stack-cache" , debug_assertions ) ) ]
413+ #[ cfg( feature = "stack-cache-consistency-check" ) ]
414414 self . verify_cache_consistency ( ) ;
415415
416416 Ok ( ( ) )
@@ -465,7 +465,7 @@ impl<'tcx> Stack {
465465 self . unique_range = 0 ..0 ;
466466 }
467467
468- #[ cfg( all ( feature = "stack-cache" , debug_assertions ) ) ]
468+ #[ cfg( feature = "stack-cache-consistency-check" ) ]
469469 self . verify_cache_consistency ( ) ;
470470 Ok ( ( ) )
471471 }
0 commit comments