about summary refs log tree commit diff
path: root/tests/ui/target-feature
diff options
context:
space:
mode:
authorKivooeo <Kivooeo123@gmail.com>2025-07-01 19:28:38 +0500
committerKivooeo <Kivooeo123@gmail.com>2025-07-05 01:54:04 +0500
commit066a281f60fd5071a50cf15a28ed40f15bef7563 (patch)
treebcd7180a12756212b23681b15593e0da1a580df4 /tests/ui/target-feature
parent1549585f26881927ea8305e0724d2d1f1dc45ade (diff)
downloadrust-066a281f60fd5071a50cf15a28ed40f15bef7563.tar.gz
rust-066a281f60fd5071a50cf15a28ed40f15bef7563.zip
cleaned up some tests
Diffstat (limited to 'tests/ui/target-feature')
-rw-r--r--tests/ui/target-feature/target-feature-detection.rs19
1 files changed, 14 insertions, 5 deletions
diff --git a/tests/ui/target-feature/target-feature-detection.rs b/tests/ui/target-feature/target-feature-detection.rs
index a1894cc03db..3404bfbe782 100644
--- a/tests/ui/target-feature/target-feature-detection.rs
+++ b/tests/ui/target-feature/target-feature-detection.rs
@@ -1,3 +1,6 @@
+//! Check that `cfg!(target_feature = "...")` correctly detects available CPU features,
+//! specifically `sse2` on x86/x86_64 platforms, and correctly reports absent features.
+
 //@ run-pass
 
 #![allow(stable_features)]
@@ -10,17 +13,23 @@ fn main() {
         Ok(s) => {
             // Skip this tests on i586-unknown-linux-gnu where sse2 is disabled
             if s.contains("i586") {
-                return
+                return;
             }
         }
         Err(_) => return,
     }
     if cfg!(any(target_arch = "x86", target_arch = "x86_64")) {
-        assert!(cfg!(target_feature = "sse2"),
-                "SSE2 was not detected as available on an x86 platform");
+        assert!(
+            cfg!(target_feature = "sse2"),
+            "SSE2 was not detected as available on an x86 platform"
+        );
     }
     // check a negative case too -- certainly not enabled by default
     #[expect(unexpected_cfgs)]
-    { assert!(cfg!(not(target_feature = "ferris_wheel")),
-            "🎡 shouldn't be detected as available by default on any platform") };
+    {
+        assert!(
+            cfg!(not(target_feature = "ferris_wheel")),
+            "🎡 shouldn't be detected as available by default on any platform"
+        )
+    };
 }