From bb8ae2bfbd42df4486244493dd5ba89189f8611c Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Fri, 6 Dec 2019 09:41:14 +0100 Subject: [PATCH 1/3] Miri now supports catching panics --- .gitignore | 2 +- scripts/run_miri.sh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 665fc20..d2599e3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ target -./Cargo.lock +/Cargo.lock diff --git a/scripts/run_miri.sh b/scripts/run_miri.sh index 42f2884..817928a 100644 --- a/scripts/run_miri.sh +++ b/scripts/run_miri.sh @@ -16,6 +16,6 @@ rustup default "$MIRI_NIGHTLY" rustup component add miri cargo miri setup -cargo miri test --verbose -- -- -Zunstable-options --exclude-should-panic -cargo miri test --verbose --features union -- -- -Zunstable-options --exclude-should-panic -cargo miri test --verbose --all-features -- -- -Zunstable-options --exclude-should-panic +cargo miri test --verbose +cargo miri test --verbose --features union +cargo miri test --verbose --all-features From e36401b9b4fa4eadf355e87813367426b73168a2 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 7 Dec 2019 12:08:15 +0100 Subject: [PATCH 2/3] enable more tests in Miri and fix sue of 'std' feature --- lib.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib.rs b/lib.rs index 9a3bd63..d44e3b0 100644 --- a/lib.rs +++ b/lib.rs @@ -15,7 +15,7 @@ //! When this feature is enabled, `smallvec` depends on `std`. //! //! To depend on `smallvec` without `libstd`, use `default-features = false` in the `smallvec` -//! section of Cargo.toml to disable its `"std"` feature. +//! section of Cargo.toml to disable its `"write"` feature. //! //! ## `union` feature //! @@ -1984,7 +1984,6 @@ mod tests { ); } - #[cfg(all(feature = "std", not(miri)))] // Miri currently does not support unwinding #[test] // https://github.com/servo/rust-smallvec/issues/96 fn test_insert_many_panic() { @@ -2117,7 +2116,6 @@ mod tests { assert!(c > b); } - #[cfg(feature = "std")] #[test] fn test_hash() { use std::collections::hash_map::DefaultHasher; @@ -2381,10 +2379,10 @@ mod tests { assert_eq!(v[..], [1, 0][..]); } - #[cfg(feature = "std")] + #[cfg(feature = "write")] #[test] fn test_write() { - use io::Write; + use std::io::Write; let data = [1, 2, 3, 4, 5]; From ddfa85654cc0c2d85f28329150d637193785c0ad Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Mon, 9 Dec 2019 18:16:07 +0100 Subject: [PATCH 3/3] ignore memory leaks --- scripts/run_miri.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/run_miri.sh b/scripts/run_miri.sh index 817928a..c5e5376 100644 --- a/scripts/run_miri.sh +++ b/scripts/run_miri.sh @@ -16,6 +16,6 @@ rustup default "$MIRI_NIGHTLY" rustup component add miri cargo miri setup -cargo miri test --verbose -cargo miri test --verbose --features union -cargo miri test --verbose --all-features +cargo miri test --verbose -- -Zmiri-ignore-leaks +cargo miri test --verbose --features union -- -Zmiri-ignore-leaks +cargo miri test --verbose --all-features -- -Zmiri-ignore-leaks