diff --git a/src/bootstrap/src/bin/rustc.rs b/src/bootstrap/src/bin/rustc.rs index 649940ac3fbbd..4dd7f8281a493 100644 --- a/src/bootstrap/src/bin/rustc.rs +++ b/src/bootstrap/src/bin/rustc.rs @@ -68,10 +68,9 @@ fn main() { // otherwise, substitute whatever cargo thinks rustc should be with RUSTC_REAL. // NOTE: this means we ignore RUSTC in the environment. // FIXME: We might want to consider removing RUSTC_REAL and setting RUSTC directly? - let target_name = target - .map(|s| s.to_owned()) - .unwrap_or_else(|| env::var("CFG_COMPILER_HOST_TRIPLE").unwrap()); - let is_clippy = args[0].to_string_lossy().ends_with(&exe("clippy-driver", &target_name)); + // NOTE: we intentionally pass the name of the host, not the target. + let host = env::var("CFG_COMPILER_BUILD_TRIPLE").unwrap(); + let is_clippy = args[0].to_string_lossy().ends_with(&exe("clippy-driver", &host)); let rustc_driver = if is_clippy { if is_build_script { // Don't run clippy on build scripts (for one thing, we may not have libstd built with @@ -87,8 +86,6 @@ fn main() { // don't remove the first arg if we're being run as RUSTC instead of RUSTC_WRAPPER. // Cargo also sometimes doesn't pass the `.exe` suffix on Windows - add it manually. let current_exe = env::current_exe().expect("couldn't get path to rustc shim"); - // NOTE: we intentionally pass the name of the host, not the target. - let host = env::var("CFG_COMPILER_BUILD_TRIPLE").unwrap(); let arg0 = exe(args[0].to_str().expect("only utf8 paths are supported"), &host); if Path::new(&arg0) == current_exe { args.remove(0);