Skip to content

Commit 5d5999a

Browse files
committed
make cache consistency checks into regular debug assertions
1 parent efc76af commit 5d5999a

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ harness = false
5454

5555
[features]
5656
default = ["stack-cache"]
57-
# Will be enabled on CI via `--all-features`.
58-
expensive-debug-assertions = []
5957
stack-cache = []
6058

6159
[profile.dev]

ci.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ set -x
55
# Determine configuration
66
export RUSTFLAGS="-D warnings -C debug-assertions -C debuginfo=1"
77
export CARGO_INCREMENTAL=0
8-
export CARGO_EXTRA_FLAGS="--all-features" # in particular, expensive-debug-assertions
8+
export CARGO_EXTRA_FLAGS="--all-features"
99

1010
# Prepare
1111
echo "Build and install miri"
12-
CARGO_EXTRA_FLAGS="" ./miri install # implicitly locked -- and the *installed* Miri does *not* get the expensive-debug-assertions feature
12+
RUSTFLAGS="" ./miri install # implicitly locked, and explicitly without debug assertions
1313
./miri build --all-targets --locked # the build that all the `./miri test` below will use
1414
echo
1515

src/stacked_borrows/stack.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ impl<'tcx> Stack {
8282
/// Panics if any of the caching mechanisms have broken,
8383
/// - The StackCache indices don't refer to the parallel items,
8484
/// - There are no Unique items outside of first_unique..last_unique
85-
#[cfg(feature = "expensive-debug-assertions")]
85+
#[cfg(debug_assertions)]
8686
fn verify_cache_consistency(&self) {
8787
// Only a full cache needs to be valid. Also see the comments in find_granting_cache
8888
// and set_unknown_bottom.
@@ -115,7 +115,7 @@ impl<'tcx> Stack {
115115
tag: SbTagExtra,
116116
exposed_tags: &FxHashSet<SbTag>,
117117
) -> Result<Option<usize>, ()> {
118-
#[cfg(feature = "expensive-debug-assertions")]
118+
#[cfg(debug_assertions)]
119119
self.verify_cache_consistency();
120120

121121
let SbTagExtra::Concrete(tag) = tag else {
@@ -247,7 +247,7 @@ impl<'tcx> Stack {
247247
// This primes the cache for the next access, which is almost always the just-added tag.
248248
self.cache.add(new_idx, new);
249249

250-
#[cfg(feature = "expensive-debug-assertions")]
250+
#[cfg(debug_assertions)]
251251
self.verify_cache_consistency();
252252
}
253253

@@ -325,7 +325,7 @@ impl<'tcx> Stack {
325325
self.unique_range.end = self.unique_range.end.min(disable_start + 1);
326326
}
327327

328-
#[cfg(feature = "expensive-debug-assertions")]
328+
#[cfg(debug_assertions)]
329329
self.verify_cache_consistency();
330330

331331
Ok(())
@@ -380,7 +380,7 @@ impl<'tcx> Stack {
380380
self.unique_range = 0..0;
381381
}
382382

383-
#[cfg(feature = "expensive-debug-assertions")]
383+
#[cfg(debug_assertions)]
384384
self.verify_cache_consistency();
385385
Ok(())
386386
}

0 commit comments

Comments
 (0)