Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/project-model/src/toolchain_info/version.rs')
| -rw-r--r-- | crates/project-model/src/toolchain_info/version.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/crates/project-model/src/toolchain_info/version.rs b/crates/project-model/src/toolchain_info/version.rs index e795fdf1d6..91ba859859 100644 --- a/crates/project-model/src/toolchain_info/version.rs +++ b/crates/project-model/src/toolchain_info/version.rs @@ -9,17 +9,16 @@ use crate::{toolchain_info::QueryConfig, utf8_stdout}; pub(crate) fn get( config: QueryConfig<'_>, - extra_env: &FxHashMap<String, String>, + extra_env: &FxHashMap<String, Option<String>>, ) -> Result<Option<Version>, anyhow::Error> { let (mut cmd, prefix) = match config { QueryConfig::Cargo(sysroot, cargo_toml) => { - (sysroot.tool(Tool::Cargo, cargo_toml.parent()), "cargo ") + (sysroot.tool(Tool::Cargo, cargo_toml.parent(), extra_env), "cargo ") } QueryConfig::Rustc(sysroot, current_dir) => { - (sysroot.tool(Tool::Rustc, current_dir), "rustc ") + (sysroot.tool(Tool::Rustc, current_dir, extra_env), "rustc ") } }; - cmd.envs(extra_env); cmd.arg("--version"); let out = utf8_stdout(&mut cmd).with_context(|| format!("Failed to query rust toolchain version via `{cmd:?}`, is your toolchain setup correctly?"))?; |