mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Get rid of failure: ra_lsp_server & ra_project_model
This commit is contained in:
parent
a931fb1ef6
commit
9709bd39ca
10 changed files with 32 additions and 36 deletions
|
@ -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() };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue