From 330ec0acdbdff74be1fa75e86aab561302bf5700 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 7 Nov 2020 15:56:25 +0100 Subject: [PATCH] enable overflow checks in the standard library --- cargo-miri/bin.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cargo-miri/bin.rs b/cargo-miri/bin.rs index 6eff5f795e7c..d18e9608cf50 100644 --- a/cargo-miri/bin.rs +++ b/cargo-miri/bin.rs @@ -354,7 +354,8 @@ path = "lib.rs" 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"); + // But keep the overflow checks, they are cheap. + command.env("RUSTFLAGS", "-Cdebug-assertions=off -Coverflow-checks=on"); // Finally run it! if command.status().expect("failed to run xargo").success().not() { show_error(format!("failed to run xargo"));