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-12-13 17:26:22 -0600
committerGitHub <noreply@github.com>2018-12-13 17:26:22 -0600
commit5a45175fe150d49347d665a0716e842ab3c60bcc (patch)
tree1802da50fc461b22cea7b5fe7e9c3bf6100d65cc /library/stdarch/crates/simd-test-macro/src/lib.rs
parent80a3099792351411e7024e26743ea98887477fb6 (diff)
downloadrust-5a45175fe150d49347d665a0716e842ab3c60bcc.tar.gz
rust-5a45175fe150d49347d665a0716e842ab3c60bcc.zip
Run rustfmt on stable, delete rustfmt.toml (#619)
This commit switches CI to running `rustfmt` on the stable compiler (as
rustfmt is stable now!). Additionally it deletes `rustfmt.toml` to
ensure we're following the same style as the rest of the ecosystem.
Diffstat (limited to 'library/stdarch/crates/simd-test-macro/src/lib.rs')
-rw-r--r--library/stdarch/crates/simd-test-macro/src/lib.rs21
1 files changed, 12 insertions, 9 deletions
diff --git a/library/stdarch/crates/simd-test-macro/src/lib.rs b/library/stdarch/crates/simd-test-macro/src/lib.rs
index 4c98de41fdf..01f8db29c01 100644
--- a/library/stdarch/crates/simd-test-macro/src/lib.rs
+++ b/library/stdarch/crates/simd-test-macro/src/lib.rs
@@ -18,7 +18,8 @@ fn string(s: &str) -> TokenTree {
 
 #[proc_macro_attribute]
 pub fn simd_test(
-    attr: proc_macro::TokenStream, item: proc_macro::TokenStream,
+    attr: proc_macro::TokenStream,
+    item: proc_macro::TokenStream,
 ) -> proc_macro::TokenStream {
     let tokens = TokenStream::from(attr).into_iter().collect::<Vec<_>>();
     if tokens.len() != 3 {
@@ -49,16 +50,18 @@ pub fn simd_test(
     let item = TokenStream::from(item);
     let name = find_name(item.clone());
 
-    let name: TokenStream = name.to_string().parse().unwrap_or_else(|_| {
-        panic!("failed to parse name: {}", name.to_string())
-    });
+    let name: TokenStream = name
+        .to_string()
+        .parse()
+        .unwrap_or_else(|_| panic!("failed to parse name: {}", name.to_string()));
 
-    let target = env::var("TARGET")
-        .expect("TARGET environment variable should be set for rustc");
+    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().unwrap_or_else(|| {
-        panic!("target triple contained no \"-\": {}", target)
-    }) {
+    let macro_test = match target
+        .split('-')
+        .next()
+        .unwrap_or_else(|| panic!("target triple contained no \"-\": {}", target))
+    {
         "i686" | "x86_64" | "i586" => "is_x86_feature_detected",
         "arm" | "armv7" => "is_arm_feature_detected",
         "aarch64" => "is_aarch64_feature_detected",