about summary refs log tree commit diff
path: root/compiler/rustc_codegen_cranelift/build_system/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_codegen_cranelift/build_system/main.rs')
-rw-r--r--compiler/rustc_codegen_cranelift/build_system/main.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/compiler/rustc_codegen_cranelift/build_system/main.rs b/compiler/rustc_codegen_cranelift/build_system/main.rs
index cdd2bae03f8..7dbf608f991 100644
--- a/compiler/rustc_codegen_cranelift/build_system/main.rs
+++ b/compiler/rustc_codegen_cranelift/build_system/main.rs
@@ -147,9 +147,11 @@ fn main() {
 
     let rustup_toolchain_name = match (env::var("CARGO"), env::var("RUSTC"), env::var("RUSTDOC")) {
         (Ok(_), Ok(_), Ok(_)) => None,
-        (Err(_), Err(_), Err(_)) => Some(rustc_info::get_toolchain_name()),
-        _ => {
-            eprintln!("All of CARGO, RUSTC and RUSTDOC need to be set or none must be set");
+        (_, Err(_), Err(_)) => Some(rustc_info::get_toolchain_name()),
+        vars => {
+            eprintln!(
+                "If RUSTC or RUSTDOC is set, both need to be set and in addition CARGO needs to be set: {vars:?}"
+            );
             process::exit(1);
         }
     };