Skip to content

Commit cc7e7bc

Browse files
committed
cargo-miri: better error when we seem to run inside bootstrap but something is wrong
1 parent 7e3a971 commit cc7e7bc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/tools/miri/cargo-miri/src/setup.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,10 @@ pub fn setup(
100100
// for target crates.
101101
let cargo_miri_path = std::env::current_exe().expect("current executable path invalid");
102102
if env::var_os("RUSTC_STAGE").is_some() {
103-
assert!(env::var_os("RUSTC").is_some());
103+
assert!(
104+
env::var_os("RUSTC").is_some() && env::var_os("RUSTC_WRAPPER").is_some(),
105+
"cargo-miri setup is running inside rustc bootstrap but RUSTC or RUST_WRAPPER is not set"
106+
);
104107
command.env("RUSTC_REAL", &cargo_miri_path);
105108
} else {
106109
command.env("RUSTC", &cargo_miri_path);

0 commit comments

Comments
 (0)