1404: Fight down failures! r=matklad a=mominul

issue #1400 

Now only `ra_tools` crate depends on `failure`, should I also fight those? 😁

Co-authored-by: Muhammad Mominul Huque <mominul2082@gmail.com>
This commit is contained in:
bors[bot] 2019-06-15 09:45:55 +00:00
commit 257a15b939
21 changed files with 61 additions and 78 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() };