Skip to content

Commit

Permalink
cargo-miri: better error when we seem to run inside bootstrap but som…
Browse files Browse the repository at this point in the history
…ething is wrong
  • Loading branch information
RalfJung committed Jul 30, 2024
1 parent 04c7187 commit 191450d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cargo-miri/src/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,10 @@ pub fn setup(
// for target crates.
let cargo_miri_path = std::env::current_exe().expect("current executable path invalid");
if env::var_os("RUSTC_STAGE").is_some() {
assert!(env::var_os("RUSTC").is_some());
assert!(
env::var_os("RUSTC").is_some() && env::var_os("RUSTC_WRAPPER").is_some(),
"cargo-miri setup is running inside rustc bootstrap but RUSTC or RUST_WRAPPER is not set"
);
command.env("RUSTC_REAL", &cargo_miri_path);
} else {
command.env("RUSTC", &cargo_miri_path);
Expand Down

0 comments on commit 191450d

Please sign in to comment.