From d4e8d0b935900e716b6154a9458730c29a67c182 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Wed, 11 Jul 2018 17:42:35 +0200 Subject: [PATCH] fix deprecation warning: use dirs crate for home_dir --- Cargo.toml | 1 + tests/compiletest.rs | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 86ac2c040fd1..54a1c5456e47 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,3 +31,4 @@ cargo_miri = ["cargo_metadata"] [dev-dependencies] compiletest_rs = { version = "0.3.4", features = ["tmp"] } +dirs = "1.0.2" diff --git a/tests/compiletest.rs b/tests/compiletest.rs index e62fa4e65e63..342ea92280de 100644 --- a/tests/compiletest.rs +++ b/tests/compiletest.rs @@ -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");