Get rid of failure: ra_lsp_server & ra_project_model

This commit is contained in:
Muhammad Mominul Huque 2019-06-15 02:42:56 +06:00
parent a931fb1ef6
commit 9709bd39ca
No known key found for this signature in database
GPG key ID: 37AF141540DE557D
10 changed files with 32 additions and 36 deletions

View file

@ -38,18 +38,18 @@ impl Sysroot {
.args(&["--print", "sysroot"])
.output()?;
if !rustc_output.status.success() {
failure::bail!("failed to locate sysroot")
Err("failed to locate 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!(
Err(format!(
"can't load standard library from sysroot\n\
{:?}\n\
try running `rustup component add rust-src`",
src,
);
))?;
}
let mut sysroot = Sysroot { crates: Arena::default() };