Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 5cbb629

Browse files
authored
Unrolled build for rust-lang#123489
Rollup merge of rust-lang#123489 - onur-ozkan:handle-rustc-args-properly, r=clubby789 handle rustc args properly in bootstrap Because `RUSTFLAGS` gets overwritten during the conversion from `Cargo` to `Command`, the passed rustc args were being lost. This change combines the rustc args with the values that override `RUSTFLAGS`. Fixes rust-lang#123228
2 parents 5958f5e + 199589d commit 5cbb629

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/bootstrap/src/core/builder.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2102,12 +2102,10 @@ impl<'a> Builder<'a> {
21022102
rustdocflags.arg("--cfg=parallel_compiler");
21032103
}
21042104

2105-
// set rustc args passed from command line
2106-
let rustc_args =
2107-
self.config.cmd.rustc_args().iter().map(|s| s.to_string()).collect::<Vec<_>>();
2108-
if !rustc_args.is_empty() {
2109-
cargo.env("RUSTFLAGS", &rustc_args.join(" "));
2110-
}
2105+
// Pass the value of `--rustc-args` from test command. If it's not a test command, this won't set anything.
2106+
self.config.cmd.rustc_args().iter().for_each(|v| {
2107+
rustflags.arg(v);
2108+
});
21112109

21122110
Cargo {
21132111
command: cargo,

0 commit comments

Comments
 (0)