Merge pull request #392 from RalfJung/dirs

fix deprecation warning: use dirs crate for home_dir
This commit is contained in:
Oliver Schneider 2018-07-11 17:59:04 +02:00 committed by GitHub
commit ef64c25bd0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -31,3 +31,4 @@ cargo_miri = ["cargo_metadata"]
[dev-dependencies]
compiletest_rs = { version = "0.3.4", features = ["tmp"] }
dirs = "1.0.2"

View file

@ -1,6 +1,7 @@
#![feature(slice_concat_ext)]
extern crate compiletest_rs as compiletest;
extern crate dirs;
use std::slice::SliceConcatExt;
use std::path::{PathBuf, Path};
@ -50,7 +51,7 @@ fn compile_fail(sysroot: &Path, path: &str, target: &str, host: &str, fullmir: b
// skip fullmir on nonhost
return;
}
let sysroot = std::env::home_dir().unwrap()
let sysroot = dirs::home_dir().unwrap()
.join(".xargo")
.join("HOST");
flags.push(format!("--sysroot {}", sysroot.to_str().unwrap()));
@ -110,7 +111,7 @@ fn miri_pass(path: &str, target: &str, host: &str, fullmir: bool, opt: bool) {
// skip fullmir on nonhost
return;
}
let sysroot = std::env::home_dir().unwrap()
let sysroot = dirs::home_dir().unwrap()
.join(".xargo")
.join("HOST");