Skip to content

Commit

Permalink
Merge #99
Browse files Browse the repository at this point in the history
99: miri: enable leakcheck r=matklad a=RalfJung

rust-lang/miri#940 is fixed, so we should be able to enable the leak checker now. :)

(However, we'll have to wait until rust-lang/rust#70897 lands so that this is available via rustup.)

Co-authored-by: Ralf Jung <[email protected]>
  • Loading branch information
bors[bot] and RalfJung authored Apr 10, 2020
2 parents 3835d6e + 2f0fd3e commit 4f974ef
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 1 addition & 3 deletions run-miri-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,4 @@ rustup toolchain add "$MIRI_NIGHTLY"
rustup component add miri --toolchain "$MIRI_NIGHTLY"
rustup run "$MIRI_NIGHTLY" -- cargo miri setup

# Miri considers runtime-allocated data in statics as leaked, so we
# have to ignore leeks. See <https://github.com/rust-lang/miri/issues/940>.
rustup run "$MIRI_NIGHTLY" -- cargo miri test -- -Zmiri-ignore-leaks
rustup run "$MIRI_NIGHTLY" -- cargo miri test
2 changes: 0 additions & 2 deletions tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,6 @@ mod sync {
}

#[test]
#[cfg_attr(miri, ignore)] // leaks memory
fn static_lazy() {
static XS: Lazy<Vec<i32>> = Lazy::new(|| {
let mut xs = Vec::new();
Expand All @@ -467,7 +466,6 @@ mod sync {
}

#[test]
#[cfg_attr(miri, ignore)] // leaks memory
fn static_lazy_via_fn() {
fn xs() -> &'static Vec<i32> {
static XS: OnceCell<Vec<i32>> = OnceCell::new();
Expand Down

0 comments on commit 4f974ef

Please sign in to comment.