diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs index f0054c36c0c88..afde076a35a50 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -859,12 +859,12 @@ impl<'a> Builder<'a> { stage = compiler.stage; } - let mut extra_args = env::var(&format!("RUSTFLAGS_STAGE_{}", stage)).unwrap_or_default(); + let mut extra_args = String::new(); if stage != 0 { - let s = env::var("RUSTFLAGS_STAGE_NOT_0").unwrap_or_default(); - if !extra_args.is_empty() { - extra_args.push_str(" "); - } + let s = env::var("RUSTFLAGS_NOT_BOOTSTRAP").unwrap_or_default(); + extra_args.push_str(&s); + } else { + let s = env::var("RUSTFLAGS_BOOTSTRAP").unwrap_or_default(); extra_args.push_str(&s); }