Skip to content

Commit

Permalink
miri: enable leakcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Apr 7, 2020
1 parent 3835d6e commit 2f0fd3e
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 2f0fd3e

Please sign in to comment.