mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
More specific error if rustc --print sysroot
fails
This commit is contained in:
parent
5b703bdc58
commit
5a71eb8749
1 changed files with 2 additions and 1 deletions
|
@ -99,7 +99,8 @@ fn try_find_src_path(cargo_toml: &Path) -> Result<PathBuf> {
|
||||||
let rustc_output = Command::new("rustc")
|
let rustc_output = Command::new("rustc")
|
||||||
.current_dir(cargo_toml.parent().unwrap())
|
.current_dir(cargo_toml.parent().unwrap())
|
||||||
.args(&["--print", "sysroot"])
|
.args(&["--print", "sysroot"])
|
||||||
.output()?;
|
.output()
|
||||||
|
.map_err(|e| format!("rustc --print sysroot failed: {}", e))?;
|
||||||
if !rustc_output.status.success() {
|
if !rustc_output.status.success() {
|
||||||
Err("failed to locate sysroot")?;
|
Err("failed to locate sysroot")?;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue