Skip to content

Commit

Permalink
Even more cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron1011 committed Jan 9, 2020
1 parent 2a6121a commit df667ff
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/bin/cargo-miri.rs
Original file line number Diff line number Diff line change
Expand Up @@ -533,10 +533,6 @@ fn in_cargo_miri() {
let args_vec: Vec<String> = args.collect();
cmd.env("MIRI_MAGIC_ARGS", serde_json::to_string(&args_vec).expect("failed to serialize args"));

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

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

0 comments on commit df667ff

Please sign in to comment.