mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 11:59:49 +00:00
fix: rust-project.json projects not preferring sysroot rustc
This commit is contained in:
parent
d4d9d0c85a
commit
64c17a9b2e
6 changed files with 25 additions and 18 deletions
|
@ -199,6 +199,19 @@ impl Sysroot {
|
|||
}
|
||||
}
|
||||
|
||||
/// Returns a `Command` that is configured to run `rustc` from the sysroot if it exists,
|
||||
/// otherwise returns what [toolchain::Tool::Rustc] returns.
|
||||
pub fn rustc(sysroot: Option<&Self>) -> Command {
|
||||
let mut cmd = Command::new(match sysroot {
|
||||
Some(sysroot) => {
|
||||
toolchain::Tool::Rustc.path_in_or_discover(sysroot.root.join("bin").as_ref())
|
||||
}
|
||||
None => toolchain::Tool::Rustc.path(),
|
||||
});
|
||||
Self::set_rustup_toolchain_env(&mut cmd, sysroot);
|
||||
cmd
|
||||
}
|
||||
|
||||
pub fn discover_proc_macro_srv(&self) -> anyhow::Result<AbsPathBuf> {
|
||||
["libexec", "lib"]
|
||||
.into_iter()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue