Skip to content

Commit 1044099

Browse files
committed
disable debug assertions in the standard library
1 parent c7c77b1 commit 1044099

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

cargo-miri/bin.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,8 @@ path = "lib.rs"
353353
// to the sysroot either.
354354
command.env_remove("RUSTC_WRAPPER");
355355
command.env_remove("RUSTFLAGS");
356+
// Disable debug assertions in the standard library -- Miri is already slow enough.
357+
command.env("RUSTFLAGS", "-Cdebug-assertions=off");
356358
// Finally run it!
357359
if command.status().expect("failed to run xargo").success().not() {
358360
show_error(format!("failed to run xargo"));

tests/run-pass/panic/catch_panic.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ fn main() {
7878
// Assertion and debug assertion
7979
test(None, |_old_val| { assert!(false); loop {} });
8080
test(None, |_old_val| { debug_assert!(false); loop {} });
81-
test(None, |_old_val| { unsafe { std::char::from_u32_unchecked(0xFD10000); } loop {} }); // trigger debug-assertion in libstd
8281

8382
eprintln!("Success!"); // Make sure we get this in stderr
8483
}

tests/run-pass/panic/catch_panic.stderr

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,4 @@ thread 'main' panicked at 'assertion failed: false', $DIR/catch_panic.rs:LL:29
2323
Caught panic message (&str): assertion failed: false
2424
thread 'main' panicked at 'assertion failed: false', $DIR/catch_panic.rs:LL:29
2525
Caught panic message (&str): assertion failed: false
26-
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', $LOC
27-
Caught panic message (&str): called `Option::unwrap()` on a `None` value
2826
Success!

0 commit comments

Comments
 (0)