6185: Add note if RUST_SRC_PATH is likely to be wrong r=jonas-schievink a=jonas-schievink

bors r+ 🤖

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
This commit is contained in:
bors[bot] 2020-10-09 14:18:29 +00:00 committed by GitHub
commit 95c498d913
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -90,9 +90,15 @@ impl Sysroot {
}
if sysroot.by_name("core").is_none() {
let var_note = if env::var_os("RUST_SRC_PATH").is_some() {
" (`RUST_SRC_PATH` might be incorrect, try unsetting it)"
} else {
""
};
anyhow::bail!(
"could not find libcore in sysroot path `{}`",
sysroot_src_dir.as_ref().display()
"could not find libcore in sysroot path `{}`{}",
sysroot_src_dir.as_ref().display(),
var_note,
);
}