From 191450d2762ead73a1821a65ae2c62f61fcb90eb Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Tue, 30 Jul 2024 12:12:41 +0200 Subject: [PATCH] cargo-miri: better error when we seem to run inside bootstrap but something is wrong --- cargo-miri/src/setup.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cargo-miri/src/setup.rs b/cargo-miri/src/setup.rs index fe67aad465..0cf6f1a375 100644 --- a/cargo-miri/src/setup.rs +++ b/cargo-miri/src/setup.rs @@ -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);