File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -526,6 +526,11 @@ fn in_cargo_miri() {
526
526
cmd. arg ( arg) ;
527
527
}
528
528
529
+ // Serialize our actual args into a special environemt variable.
530
+ // This will be read by `inside_cargo_rustc` when we go to invoke
531
+ // our actual target crate (the binary or the test we are running).
532
+ // Since we're using "cargo check", we have no other way of passing
533
+ // these arguments.
529
534
let args_vec: Vec < String > = args. collect ( ) ;
530
535
cmd. env ( "MIRI_MAGIC_ARGS" , serde_json:: to_string ( & args_vec) . expect ( "failed to serialize args" ) ) ;
531
536
@@ -559,6 +564,10 @@ fn inside_cargo_rustc() {
559
564
560
565
let in_build_script = is_build_dep ( ) ;
561
566
567
+ // Build scripts need to be compiled to actual runnable executables,
568
+ // and therefore completely bypass Miri. We make sure to only specify
569
+ // our custom Xargo sysroot for non-build-script crate - that is,
570
+ // crates which are ultimately going to get interpreted by Miri.
562
571
let mut args = if in_build_script {
563
572
rustc_args. collect ( )
564
573
} else {
You can’t perform that action at this time.
0 commit comments