Skip to content

Miri now supports catching panics #186

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
target
./Cargo.lock
/Cargo.lock
8 changes: 3 additions & 5 deletions lib.rs
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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