Skip to content

Commit ff6a7c7

Browse files
committed
No need to remove target-specific RUSTFLAGS
Turns out Cargo favors RUSTFLAGS!
1 parent 7342325 commit ff6a7c7

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/bootstrap/builder.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,7 @@ impl<'a> Builder<'a> {
815815
stage = compiler.stage;
816816
}
817817

818-
let mut rustflags = Rustflags::new(&target, &mut cargo);
818+
let mut rustflags = Rustflags::new(&target);
819819
if stage != 0 {
820820
rustflags.env("RUSTFLAGS_NOT_BOOTSTRAP");
821821
} else {
@@ -1339,18 +1339,16 @@ mod tests;
13391339
struct Rustflags(String);
13401340

13411341
impl Rustflags {
1342-
fn new(target: &str, cmd: &mut Command) -> Rustflags {
1342+
fn new(target: &str) -> Rustflags {
13431343
let mut ret = Rustflags(String::new());
13441344

13451345
// Inherit `RUSTFLAGS` by default ...
13461346
ret.env("RUSTFLAGS");
13471347

13481348
// ... and also handle target-specific env RUSTFLAGS if they're
1349-
// configured. If this is configured we also remove it from the
1350-
// environment because Cargo will prefer it over RUSTFLAGS.
1349+
// configured.
13511350
let target_specific = format!("CARGO_TARGET_{}_RUSTFLAGS", crate::envify(target));
13521351
ret.env(&target_specific);
1353-
cmd.env_remove(&target_specific);
13541352

13551353
ret
13561354
}

0 commit comments

Comments
 (0)