From d4ba942b17a7bfde7ae3726218742e6d78fa62b1 Mon Sep 17 00:00:00 2001 From: Michael Gehring Date: Sat, 11 Oct 2014 16:10:43 +0200 Subject: [PATCH 1/3] Fix cfg warnings in compiletest --- src/compiletest/runtest.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/compiletest/runtest.rs b/src/compiletest/runtest.rs index 2b52ac65e4788..ab8d924a44260 100644 --- a/src/compiletest/runtest.rs +++ b/src/compiletest/runtest.rs @@ -952,10 +952,10 @@ fn check_expected_errors(expected_errors: Vec , to_lower(line).as_slice().starts_with(to_lower(prefix).as_slice()) } - #[cfg(target_os = "linux")] - #[cfg(target_os = "macos")] - #[cfg(target_os = "freebsd")] - #[cfg(target_os = "dragonfly")] + #[cfg(any(target_os = "linux", + target_os = "macos", + target_os = "freebsd", + target_os = "dragonfly"))] fn prefix_matches( line : &str, prefix : &str ) -> bool { line.starts_with( prefix ) } @@ -1356,10 +1356,10 @@ fn program_output(config: &Config, testfile: &Path, lib_path: &str, prog: String } // Linux and mac don't require adjusting the library search path -#[cfg(target_os = "linux")] -#[cfg(target_os = "macos")] -#[cfg(target_os = "freebsd")] -#[cfg(target_os = "dragonfly")] +#[cfg(any(target_os = "linux", + target_os = "macos", + target_os = "freebsd", + target_os = "dragonfly"))] fn make_cmdline(_libpath: &str, prog: &str, args: &[String]) -> String { format!("{} {}", prog, args.connect(" ")) } From 22cc5d5e62002c5de6f3746b3a7e4f37e36440b6 Mon Sep 17 00:00:00 2001 From: Michael Gehring Date: Sat, 11 Oct 2014 18:32:40 +0200 Subject: [PATCH 2/3] Fix cfg warnings in libcoretest --- src/libcoretest/mem.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/libcoretest/mem.rs b/src/libcoretest/mem.rs index fde640158f51e..76409c8612f33 100644 --- a/src/libcoretest/mem.rs +++ b/src/libcoretest/mem.rs @@ -19,10 +19,10 @@ fn size_of_basic() { } #[test] -#[cfg(target_arch = "x86")] -#[cfg(target_arch = "arm")] -#[cfg(target_arch = "mips")] -#[cfg(target_arch = "mipsel")] +#[cfg(any(target_arch = "x86", + target_arch = "arm", + target_arch = "mips", + target_arch = "mipsel"))] fn size_of_32() { assert_eq!(size_of::(), 4u); assert_eq!(size_of::<*const uint>(), 4u); @@ -51,10 +51,10 @@ fn align_of_basic() { } #[test] -#[cfg(target_arch = "x86")] -#[cfg(target_arch = "arm")] -#[cfg(target_arch = "mips")] -#[cfg(target_arch = "mipsel")] +#[cfg(any(target_arch = "x86", + target_arch = "arm", + target_arch = "mips", + target_arch = "mipsel"))] fn align_of_32() { assert_eq!(align_of::(), 4u); assert_eq!(align_of::<*const uint>(), 4u); From 151aaaf46ba7ba9c53f3e7df7a04b93cf1b8fd9f Mon Sep 17 00:00:00 2001 From: Michael Gehring Date: Sat, 11 Oct 2014 18:32:57 +0200 Subject: [PATCH 3/3] Fix cfg warnings in librustc_back --- src/librustc_back/rpath.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/librustc_back/rpath.rs b/src/librustc_back/rpath.rs index abb594d6e47a8..a7a234dc18ac5 100644 --- a/src/librustc_back/rpath.rs +++ b/src/librustc_back/rpath.rs @@ -200,8 +200,7 @@ mod test { } #[test] - #[cfg(target_os = "linux")] - #[cfg(target_os = "android")] + #[cfg(any(target_os = "linux", target_os = "android"))] fn test_rpath_relative() { let config = &mut RPathConfig { os: abi::OsLinux,