warn louder on mising sysroot

This commit is contained in:
Aleksey Kladov 2019-01-11 21:27:25 +03:00
parent 738c958a04
commit f60153ee9e
2 changed files with 9 additions and 1 deletions

View File

@ -65,7 +65,7 @@ pub fn main_loop(
let workspaces = match ws_worker.recv().unwrap() {
Ok(ws) => vec![ws],
Err(e) => {
log::warn!("loading workspace failed: {}", e);
log::error!("loading workspace failed: {}", e);
Vec::new()
}
};

View File

@ -44,6 +44,14 @@ impl Sysroot {
let stdout = String::from_utf8(rustc_output.stdout)?;
let sysroot_path = Path::new(stdout.trim());
let src = sysroot_path.join("lib/rustlib/src/rust/src");
if !src.exists() {
failure::bail!(
"can't load standard library from sysroot\n\
{:?}\n\
try running `rustup component add rust-src`",
src,
);
}
let mut sysroot = Sysroot {
crates: Arena::default(),