]> git.lizzy.rs Git - rust.git/commitdiff
fix deprecation warning: use dirs crate for home_dir
authorRalf Jung <post@ralfj.de>
Wed, 11 Jul 2018 15:42:35 +0000 (17:42 +0200)
committerRalf Jung <post@ralfj.de>
Wed, 11 Jul 2018 15:42:35 +0000 (17:42 +0200)
Cargo.toml
tests/compiletest.rs

index 86ac2c040fd1c73e1377da2b0bbd4f3ae93a0d40..54a1c5456e47d79992747b81ab67ca77c73e8576 100644 (file)
@@ -31,3 +31,4 @@ cargo_miri = ["cargo_metadata"]
 
 [dev-dependencies]
 compiletest_rs = { version = "0.3.4", features = ["tmp"] }
+dirs = "1.0.2"
index e62fa4e65e63045de6ce1b91d34a9868a0d13f27..342ea92280de038510c008fa5218fffd8f90e7ca 100644 (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");