3084: More specific error if `rustc --print sysroot` fails r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
bors[bot] 2020-02-10 16:05:27 +00:00 committed by GitHub
commit 29f5e7eebf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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")?;
}