Skip to content

Commit df667ff

Browse files
committed
Even more cleanup
1 parent 2a6121a commit df667ff

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/bin/cargo-miri.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -533,10 +533,6 @@ fn in_cargo_miri() {
533533
let args_vec: Vec<String> = args.collect();
534534
cmd.env("MIRI_MAGIC_ARGS", serde_json::to_string(&args_vec).expect("failed to serialize args"));
535535

536-
// Add `--` (to end the `cargo` flags), and then the user flags. We add markers around the
537-
// user flags to be able to identify them later. "cargo rustc" adds more stuff after this,
538-
// so we have to mark both the beginning and the end.
539-
//cmd.arg("--").arg("cargo-miri-marker-begin").args(args).arg("cargo-miri-marker-end");
540536
let path = std::env::current_exe().expect("current executable path invalid");
541537
cmd.env("RUSTC_WRAPPER", path);
542538
if verbose {
@@ -574,11 +570,12 @@ fn inside_cargo_rustc() {
574570
args
575571
};
576572

577-
// See if we can find the `cargo-miri` markers. Those only get added to the binary we want to
578-
// run. They also serve to mark the user-defined arguments, which we have to move all the way
579-
// to the end (they get added somewhere in the middle).
580573
let needs_miri =
581574
if is_target_crate(in_build_script) {
575+
// This is the 'target crate '- the binary or test crate that
576+
// we want to interpret under Miri. We deserialize the user-provided arguments
577+
// from the special environment variable "MIRI_MAGIC_ARGS", and feed them
578+
// to the 'miri' binary.
582579
let magic = std::env::var("MIRI_MAGIC_ARGS").expect("missing MIRI_MAGIC_ARGS");
583580
let mut user_args: Vec<String> = serde_json::from_str(&magic).expect("failed to deserialize args");
584581
args.append(&mut user_args);

0 commit comments

Comments
 (0)