Unnamed repository; edit this file 'description' to name the repository.
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
Chayim Refael Friedman 8 months ago
parent a271dac · parent 32e2b60 · commit 21614ed
-rw-r--r--crates/project-model/src/toolchain_info/target_data_layout.rs7
1 files changed, 2 insertions, 5 deletions
diff --git a/crates/project-model/src/toolchain_info/target_data_layout.rs b/crates/project-model/src/toolchain_info/target_data_layout.rs
index a28f468e69..f1d99cb8b0 100644
--- a/crates/project-model/src/toolchain_info/target_data_layout.rs
+++ b/crates/project-model/src/toolchain_info/target_data_layout.rs
@@ -23,14 +23,11 @@ pub fn get(
QueryConfig::Cargo(sysroot, cargo_toml, _) => {
let mut cmd = sysroot.tool(Tool::Cargo, cargo_toml.parent(), extra_env);
cmd.env("RUSTC_BOOTSTRAP", "1");
- cmd.args(["rustc", "-Z", "unstable-options"]).args(RUSTC_ARGS).args([
- "--",
- "-Z",
- "unstable-options",
- ]);
+ cmd.args(["rustc", "-Z", "unstable-options"]).args(RUSTC_ARGS);
if let Some(target) = target {
cmd.args(["--target", target]);
}
+ cmd.args(["--", "-Z", "unstable-options"]);
match utf8_stdout(&mut cmd) {
Ok(output) => return process(output),
Err(e) => {