From 9703bb81923d23acf064543c17acac7ee071a1e5 Mon Sep 17 00:00:00 2001 From: Jethro Beekman Date: Mon, 7 Dec 2020 15:14:56 +0100 Subject: [PATCH] Fix SGX CI, take 3 Broken in #79038 --- library/std/tests/env.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/library/std/tests/env.rs b/library/std/tests/env.rs index 76056637a4c..b095c2dde62 100644 --- a/library/std/tests/env.rs +++ b/library/std/tests/env.rs @@ -78,9 +78,11 @@ fn test_env_set_var() { } #[test] -#[cfg_attr(any(target_os = "emscripten", target_env = "sgx"), ignore)] +#[cfg_attr(not(any(unix, windows)), ignore, allow(unused))] #[allow(deprecated)] fn env_home_dir() { + use std::path::PathBuf; + fn var_to_os_string(var: Result) -> Option { match var { Ok(var) => Some(OsString::from(var)), @@ -91,8 +93,6 @@ fn env_home_dir() { cfg_if::cfg_if! { if #[cfg(unix)] { - use std::path::PathBuf; - let oldhome = var_to_os_string(var("HOME")); set_var("HOME", "/home/MountainView"); @@ -110,8 +110,6 @@ fn env_home_dir() { if let Some(oldhome) = oldhome { set_var("HOME", oldhome); } } else if #[cfg(windows)] { - use std::path::PathBuf; - let oldhome = var_to_os_string(var("HOME")); let olduserprofile = var_to_os_string(var("USERPROFILE"));