Skip to content

Commit c271f82

Browse files
committed
Add some additional comments
1 parent 377168a commit c271f82

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/bin/cargo-miri.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,11 @@ fn in_cargo_miri() {
526526
cmd.arg(arg);
527527
}
528528

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.
529534
let args_vec: Vec<String> = args.collect();
530535
cmd.env("MIRI_MAGIC_ARGS", serde_json::to_string(&args_vec).expect("failed to serialize args"));
531536

@@ -559,6 +564,10 @@ fn inside_cargo_rustc() {
559564

560565
let in_build_script = is_build_dep();
561566

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.
562571
let mut args = if in_build_script {
563572
rustc_args.collect()
564573
} else {

0 commit comments

Comments
 (0)