Skip to content

Commit 21614ed

Browse files
Merge pull request #20579 from Elliot-Roberts/fix-double-target-option
fix: Avoid `--target` option being given twice to `rustc` when invoked through `cargo rustc` while fetching target data layout
2 parents a271dac + 32e2b60 commit 21614ed

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

crates/project-model/src/toolchain_info/target_data_layout.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,11 @@ pub fn get(
2323
QueryConfig::Cargo(sysroot, cargo_toml, _) => {
2424
let mut cmd = sysroot.tool(Tool::Cargo, cargo_toml.parent(), extra_env);
2525
cmd.env("RUSTC_BOOTSTRAP", "1");
26-
cmd.args(["rustc", "-Z", "unstable-options"]).args(RUSTC_ARGS).args([
27-
"--",
28-
"-Z",
29-
"unstable-options",
30-
]);
26+
cmd.args(["rustc", "-Z", "unstable-options"]).args(RUSTC_ARGS);
3127
if let Some(target) = target {
3228
cmd.args(["--target", target]);
3329
}
30+
cmd.args(["--", "-Z", "unstable-options"]);
3431
match utf8_stdout(&mut cmd) {
3532
Ok(output) => return process(output),
3633
Err(e) => {

0 commit comments

Comments
 (0)