From f60153ee9e1d598c170743633448aa3ede8cb72e Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 11 Jan 2019 21:27:25 +0300 Subject: warn louder on mising sysroot --- crates/ra_lsp_server/src/main_loop.rs | 2 +- crates/ra_lsp_server/src/project_model/sysroot.rs | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'crates/ra_lsp_server') diff --git a/crates/ra_lsp_server/src/main_loop.rs b/crates/ra_lsp_server/src/main_loop.rs index c43637351..6b9f6a988 100644 --- a/crates/ra_lsp_server/src/main_loop.rs +++ b/crates/ra_lsp_server/src/main_loop.rs @@ -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() } }; diff --git a/crates/ra_lsp_server/src/project_model/sysroot.rs b/crates/ra_lsp_server/src/project_model/sysroot.rs index 1dbab57f8..3b2fa070b 100644 --- a/crates/ra_lsp_server/src/project_model/sysroot.rs +++ b/crates/ra_lsp_server/src/project_model/sysroot.rs @@ -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(), -- cgit v1.2.3