diff options
Diffstat (limited to 'src/compiletest/util.rs')
| -rw-r--r-- | src/compiletest/util.rs | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/src/compiletest/util.rs b/src/compiletest/util.rs index c0d7c59ef6a..16e2806f72c 100644 --- a/src/compiletest/util.rs +++ b/src/compiletest/util.rs @@ -8,10 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use common::Config; - -#[cfg(target_os = "windows")] use std::env; +use common::Config; /// Conversion table from triple OS name to Rust SYSNAME const OS_TABLE: &'static [(&'static str, &'static str)] = &[ @@ -36,24 +34,20 @@ pub fn get_os(triple: &str) -> &'static str { panic!("Cannot determine OS from triple"); } -#[cfg(target_os = "windows")] pub fn make_new_path(path: &str) -> String { - + assert!(cfg!(windows)); // Windows just uses PATH as the library search path, so we have to // maintain the current value while adding our own match env::var(lib_path_env_var()) { - Ok(curr) => { - format!("{}{}{}", path, path_div(), curr) - } - Err(..) => path.to_string() + Ok(curr) => { + format!("{}{}{}", path, path_div(), curr) + } + Err(..) => path.to_string() } } -#[cfg(target_os = "windows")] pub fn lib_path_env_var() -> &'static str { "PATH" } - -#[cfg(target_os = "windows")] -pub fn path_div() -> &'static str { ";" } +fn path_div() -> &'static str { ";" } pub fn logv(config: &Config, s: String) { debug!("{}", s); |
