@@ -81,7 +81,7 @@ impl<'tcx> Stack {
81
81
/// Panics if any of the caching mechanisms have broken,
82
82
/// - The StackCache indices don't refer to the parallel items,
83
83
/// - There are no Unique items outside of first_unique..last_unique
84
- #[ cfg( debug_assertions) ]
84
+ #[ cfg( all ( feature = "stack-cache" , debug_assertions) ) ]
85
85
fn verify_cache_consistency ( & self ) {
86
86
// Only a full cache needs to be valid. Also see the comments in find_granting_cache
87
87
// and set_unknown_bottom.
@@ -128,7 +128,7 @@ impl<'tcx> Stack {
128
128
tag : ProvenanceExtra ,
129
129
exposed_tags : & FxHashSet < SbTag > ,
130
130
) -> Result < Option < usize > , ( ) > {
131
- #[ cfg( debug_assertions) ]
131
+ #[ cfg( all ( feature = "stack-cache" , debug_assertions) ) ]
132
132
self . verify_cache_consistency ( ) ;
133
133
134
134
let ProvenanceExtra :: Concrete ( tag) = tag else {
@@ -320,13 +320,14 @@ impl<'tcx> Stack {
320
320
321
321
if disable_start <= unique_range. end {
322
322
let lower = unique_range. start . max ( disable_start) ;
323
- let upper = self . unique_range . end ;
323
+ let upper = unique_range. end ;
324
324
for item in & mut self . borrows [ lower..upper] {
325
325
if item. perm ( ) == Permission :: Unique {
326
326
log:: trace!( "access: disabling item {:?}" , item) ;
327
327
visitor ( * item) ?;
328
328
item. set_permission ( Permission :: Disabled ) ;
329
329
// Also update all copies of this item in the cache.
330
+ #[ cfg( feature = "stack-cache" ) ]
330
331
for it in & mut self . cache . items {
331
332
if it. tag ( ) == item. tag ( ) {
332
333
it. set_permission ( Permission :: Disabled ) ;
@@ -347,7 +348,7 @@ impl<'tcx> Stack {
347
348
self . unique_range . end = self . unique_range . end . min ( disable_start) ;
348
349
}
349
350
350
- #[ cfg( debug_assertions) ]
351
+ #[ cfg( all ( feature = "stack-cache" , debug_assertions) ) ]
351
352
self . verify_cache_consistency ( ) ;
352
353
353
354
Ok ( ( ) )
@@ -402,7 +403,7 @@ impl<'tcx> Stack {
402
403
self . unique_range = 0 ..0 ;
403
404
}
404
405
405
- #[ cfg( debug_assertions) ]
406
+ #[ cfg( all ( feature = "stack-cache" , debug_assertions) ) ]
406
407
self . verify_cache_consistency ( ) ;
407
408
Ok ( ( ) )
408
409
}
0 commit comments