Skip to content

Commit 10f4633

Browse files
committed
set RUSTC_DEBUG_ASSERTIONS for when we are in bootstrap
1 parent ab22da8 commit 10f4633

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/bin/cargo-miri.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -310,17 +310,21 @@ version = "0.0.0"
310310
path = "lib.rs"
311311
"#).unwrap();
312312
File::create(dir.join("lib.rs")).unwrap();
313-
// Run xargo.
313+
// Prepare xargo invocation.
314314
let target = get_arg_flag_value("--target");
315315
let print_env = !ask_user && has_arg_flag("--env"); // whether we just print the necessary environment variable
316316
let mut command = xargo();
317-
command.arg("build").arg("-q")
318-
.current_dir(&dir)
319-
.env("RUSTFLAGS", miri::miri_default_args().join(" "))
320-
.env("XARGO_HOME", dir.to_str().unwrap());
317+
command.arg("build").arg("-q");
318+
command.current_dir(&dir);
319+
command.env("RUSTFLAGS", miri::miri_default_args().join(" "));
320+
command.env("XARGO_HOME", dir.to_str().unwrap());
321+
// In bootstrap, make sure we don't get debug assertons into our libstd.
322+
command.env("RUSTC_DEBUG_ASSERTIONS", "false");
323+
// Handle target flag.
321324
if let Some(ref target) = target {
322325
command.arg("--target").arg(&target);
323326
}
327+
// Finally run it!
324328
if !command.status()
325329
.expect("failed to run xargo")
326330
.success()

0 commit comments

Comments
 (0)