mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 22:31:43 +00:00
warn louder on mising sysroot
This commit is contained in:
parent
738c958a04
commit
f60153ee9e
2 changed files with 9 additions and 1 deletions
|
@ -65,7 +65,7 @@ pub fn main_loop(
|
||||||
let workspaces = match ws_worker.recv().unwrap() {
|
let workspaces = match ws_worker.recv().unwrap() {
|
||||||
Ok(ws) => vec![ws],
|
Ok(ws) => vec![ws],
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
log::warn!("loading workspace failed: {}", e);
|
log::error!("loading workspace failed: {}", e);
|
||||||
Vec::new()
|
Vec::new()
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -44,6 +44,14 @@ impl Sysroot {
|
||||||
let stdout = String::from_utf8(rustc_output.stdout)?;
|
let stdout = String::from_utf8(rustc_output.stdout)?;
|
||||||
let sysroot_path = Path::new(stdout.trim());
|
let sysroot_path = Path::new(stdout.trim());
|
||||||
let src = sysroot_path.join("lib/rustlib/src/rust/src");
|
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 {
|
let mut sysroot = Sysroot {
|
||||||
crates: Arena::default(),
|
crates: Arena::default(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue