Skip to content

Commit 79ebfa2

Browse files
committed
make Miri build without the stack-cache feature
1 parent 297ddff commit 79ebfa2

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/stacked_borrows/stack.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ impl<'tcx> Stack {
8181
/// Panics if any of the caching mechanisms have broken,
8282
/// - The StackCache indices don't refer to the parallel items,
8383
/// - There are no Unique items outside of first_unique..last_unique
84-
#[cfg(debug_assertions)]
84+
#[cfg(all(feature = "stack-cache", debug_assertions))]
8585
fn verify_cache_consistency(&self) {
8686
// Only a full cache needs to be valid. Also see the comments in find_granting_cache
8787
// and set_unknown_bottom.
@@ -128,7 +128,7 @@ impl<'tcx> Stack {
128128
tag: ProvenanceExtra,
129129
exposed_tags: &FxHashSet<SbTag>,
130130
) -> Result<Option<usize>, ()> {
131-
#[cfg(debug_assertions)]
131+
#[cfg(all(feature = "stack-cache", debug_assertions))]
132132
self.verify_cache_consistency();
133133

134134
let ProvenanceExtra::Concrete(tag) = tag else {
@@ -320,13 +320,14 @@ impl<'tcx> Stack {
320320

321321
if disable_start <= unique_range.end {
322322
let lower = unique_range.start.max(disable_start);
323-
let upper = self.unique_range.end;
323+
let upper = unique_range.end;
324324
for item in &mut self.borrows[lower..upper] {
325325
if item.perm() == Permission::Unique {
326326
log::trace!("access: disabling item {:?}", item);
327327
visitor(*item)?;
328328
item.set_permission(Permission::Disabled);
329329
// Also update all copies of this item in the cache.
330+
#[cfg(feature = "stack-cache")]
330331
for it in &mut self.cache.items {
331332
if it.tag() == item.tag() {
332333
it.set_permission(Permission::Disabled);
@@ -347,7 +348,7 @@ impl<'tcx> Stack {
347348
self.unique_range.end = self.unique_range.end.min(disable_start);
348349
}
349350

350-
#[cfg(debug_assertions)]
351+
#[cfg(all(feature = "stack-cache", debug_assertions))]
351352
self.verify_cache_consistency();
352353

353354
Ok(())
@@ -402,7 +403,7 @@ impl<'tcx> Stack {
402403
self.unique_range = 0..0;
403404
}
404405

405-
#[cfg(debug_assertions)]
406+
#[cfg(all(feature = "stack-cache", debug_assertions))]
406407
self.verify_cache_consistency();
407408
Ok(())
408409
}

0 commit comments

Comments
 (0)