disable debug assertions in the standard library

This commit is contained in:
Ralf Jung 2020-10-28 10:48:33 +01:00
parent c7c77b149b
commit 1044099c19
3 changed files with 2 additions and 3 deletions

View file

@ -353,6 +353,8 @@ path = "lib.rs"
// to the sysroot either.
command.env_remove("RUSTC_WRAPPER");
command.env_remove("RUSTFLAGS");
// Disable debug assertions in the standard library -- Miri is already slow enough.
command.env("RUSTFLAGS", "-Cdebug-assertions=off");
// Finally run it!
if command.status().expect("failed to run xargo").success().not() {
show_error(format!("failed to run xargo"));

View file

@ -78,7 +78,6 @@ fn main() {
// Assertion and debug assertion
test(None, |_old_val| { assert!(false); loop {} });
test(None, |_old_val| { debug_assert!(false); loop {} });
test(None, |_old_val| { unsafe { std::char::from_u32_unchecked(0xFD10000); } loop {} }); // trigger debug-assertion in libstd
eprintln!("Success!"); // Make sure we get this in stderr
}

View file

@ -23,6 +23,4 @@ thread 'main' panicked at 'assertion failed: false', $DIR/catch_panic.rs:LL:29
Caught panic message (&str): assertion failed: false
thread 'main' panicked at 'assertion failed: false', $DIR/catch_panic.rs:LL:29
Caught panic message (&str): assertion failed: false
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', $LOC
Caught panic message (&str): called `Option::unwrap()` on a `None` value
Success!