@@ -533,10 +533,6 @@ fn in_cargo_miri() {
533
533
let args_vec: Vec < String > = args. collect ( ) ;
534
534
cmd. env ( "MIRI_MAGIC_ARGS" , serde_json:: to_string ( & args_vec) . expect ( "failed to serialize args" ) ) ;
535
535
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");
540
536
let path = std:: env:: current_exe ( ) . expect ( "current executable path invalid" ) ;
541
537
cmd. env ( "RUSTC_WRAPPER" , path) ;
542
538
if verbose {
@@ -574,11 +570,12 @@ fn inside_cargo_rustc() {
574
570
args
575
571
} ;
576
572
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).
580
573
let needs_miri =
581
574
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.
582
579
let magic = std:: env:: var ( "MIRI_MAGIC_ARGS" ) . expect ( "missing MIRI_MAGIC_ARGS" ) ;
583
580
let mut user_args: Vec < String > = serde_json:: from_str ( & magic) . expect ( "failed to deserialize args" ) ;
584
581
args. append ( & mut user_args) ;
0 commit comments