Skip to content

Commit

Permalink
Auto merge of #186 - RalfJung:miri, r=mbrubeck
Browse files Browse the repository at this point in the history
Miri now supports catching panics

Also fix a mistake in the .gitignore (at least on my system, this didn't actually ignore the lockfile)
  • Loading branch information
bors-servo committed Dec 9, 2019
2 parents c975415 + ddfa856 commit 6f0fe55
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .gitignore
@@ -1,2 +1,2 @@
target
./Cargo.lock
/Cargo.lock
8 changes: 3 additions & 5 deletions lib.rs
Expand Up @@ -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
//!
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -2117,7 +2116,6 @@ mod tests {
assert!(c > b);
}

#[cfg(feature = "std")]
#[test]
fn test_hash() {
use std::collections::hash_map::DefaultHasher;
Expand Down Expand Up @@ -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];

Expand Down
6 changes: 3 additions & 3 deletions scripts/run_miri.sh
Expand Up @@ -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 -- -Zmiri-ignore-leaks
cargo miri test --verbose --features union -- -Zmiri-ignore-leaks
cargo miri test --verbose --all-features -- -Zmiri-ignore-leaks

0 comments on commit 6f0fe55

Please sign in to comment.