mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-25 11:17:13 +00:00
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
This commit is contained in:
commit
21614ed2d3
@ -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) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user