about summary refs log tree commit diff
path: root/library/stdarch/crates/simd-test-macro/src/lib.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2018-03-22 17:40:44 -0500
committerGitHub <noreply@github.com>2018-03-22 17:40:44 -0500
commitaafe6ebb75816bb589e1da15fe3e1f5d56cda7cb (patch)
treea179013bcdd01f2f1624eb496c5ece2dcb7b8567 /library/stdarch/crates/simd-test-macro/src/lib.rs
parentfa924e754d4443f7975491a0c1aa31a0184848f9 (diff)
downloadrust-aafe6ebb75816bb589e1da15fe3e1f5d56cda7cb.tar.gz
rust-aafe6ebb75816bb589e1da15fe3e1f5d56cda7cb.zip
Fix default `cargo test` experience (#397)
Turns out Cargo doesn't automatically set `TARGET` for rustc invocations so
carry it forward manually from the build script over to the rustc invocation.
Diffstat (limited to 'library/stdarch/crates/simd-test-macro/src/lib.rs')
-rw-r--r--library/stdarch/crates/simd-test-macro/src/lib.rs15
1 files changed, 2 insertions, 13 deletions
diff --git a/library/stdarch/crates/simd-test-macro/src/lib.rs b/library/stdarch/crates/simd-test-macro/src/lib.rs
index 0ebd93691c7..63b282f4a7c 100644
--- a/library/stdarch/crates/simd-test-macro/src/lib.rs
+++ b/library/stdarch/crates/simd-test-macro/src/lib.rs
@@ -60,19 +60,8 @@ pub fn simd_test(
         name.clone().as_str()
     ));
 
-    let default_target = if cfg!(target_os = "windows") {
-        Some("x86_64-pc-windows-msvc")
-    } else if cfg!(target_os = "linux") {
-        Some("x86_64-unknown-linux-gnu")
-    } else if cfg!(target_os = "macos") {
-        Some("x86_64-apple-darwin")
-    } else {
-        None
-    };
-
-    let target = env::var("TARGET").unwrap_or_else(|_| {
-        default_target.expect("TARGET environment variable not set and no default target known for the current target.").to_string()
-    });
+    let target = env::var("TARGET")
+        .expect("TARGET environment variable should be set for rustc");
     let mut force_test = false;
     let macro_test = match target.split('-').next().expect(&format!(
         "target triple contained no \"-\": {}",