mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-27 02:06:57 +00:00
fix: Don't overwrite RUSTUP_TOOLCHAIN if it is already set
This commit is contained in:
parent
b3e086ad10
commit
09ecc4cbf6
3 changed files with 15 additions and 2 deletions
|
|
@ -137,7 +137,12 @@ impl Sysroot {
|
|||
}
|
||||
|
||||
let mut cmd = toolchain::command(tool.prefer_proxy(), current_dir, envs);
|
||||
cmd.env("RUSTUP_TOOLCHAIN", AsRef::<std::path::Path>::as_ref(root));
|
||||
if !envs.contains_key("RUSTUP_TOOLCHAIN")
|
||||
&& std::env::var_os("RUSTUP_TOOLCHAIN").is_none()
|
||||
{
|
||||
cmd.env("RUSTUP_TOOLCHAIN", AsRef::<std::path::Path>::as_ref(root));
|
||||
}
|
||||
|
||||
cmd
|
||||
}
|
||||
_ => toolchain::command(tool.path(), current_dir, envs),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue