cargo-miri: better error when we seem to run inside bootstrap but something is wrong

This commit is contained in:
Ralf Jung 2024-07-30 12:12:41 +02:00
parent 7e3a971870
commit cc7e7bc096

View File

@ -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);