More specific error if rustc --print sysroot fails

This commit is contained in:
Aleksey Kladov 2020-02-10 17:04:18 +01:00
parent 5b703bdc58
commit 5a71eb8749

View File

@ -99,7 +99,8 @@ fn try_find_src_path(cargo_toml: &Path) -> Result<PathBuf> {
let rustc_output = Command::new("rustc")
.current_dir(cargo_toml.parent().unwrap())
.args(&["--print", "sysroot"])
.output()?;
.output()
.map_err(|e| format!("rustc --print sysroot failed: {}", e))?;
if !rustc_output.status.success() {
Err("failed to locate sysroot")?;
}