about summary refs log tree commit diff
path: root/library/stdarch/crates/std_detect
diff options
context:
space:
mode:
authorAmanieu d'Antras <amanieu@gmail.com>2021-04-24 08:02:24 +0100
committerGitHub <noreply@github.com>2021-04-24 08:02:24 +0100
commit63daa088fd92f078528442929b4537612f8d724d (patch)
treea6e3a6a4d5e9e7a1db61bc287a38afa39dda81e4 /library/stdarch/crates/std_detect
parent8852d07441370620989a52a27b22608f70dc4596 (diff)
downloadrust-63daa088fd92f078528442929b4537612f8d724d.tar.gz
rust-63daa088fd92f078528442929b4537612f8d724d.zip
Move cfg!(target_feature) directly into is_*_feature_detected!() (#1141)
Fixes #1135
Diffstat (limited to 'library/stdarch/crates/std_detect')
-rw-r--r--library/stdarch/crates/std_detect/src/detect/macros.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/library/stdarch/crates/std_detect/src/detect/macros.rs b/library/stdarch/crates/std_detect/src/detect/macros.rs
index 2607e07bf37..a4af3d1c027 100644
--- a/library/stdarch/crates/std_detect/src/detect/macros.rs
+++ b/library/stdarch/crates/std_detect/src/detect/macros.rs
@@ -14,7 +14,8 @@ macro_rules! features {
         macro_rules! $macro_name {
             $(
                 ($feature_lit) => {
-                    $crate::detect::__is_feature_detected::$feature()
+                    cfg!(target_feature = $feature_lit) ||
+                        $crate::detect::__is_feature_detected::$feature()
                 };
             )*
             $(
@@ -94,8 +95,7 @@ macro_rules! features {
                 #[doc(hidden)]
                 #[$stability_attr]
                 pub fn $feature() -> bool {
-                    cfg!(target_feature = $feature_lit) ||
-                        $crate::detect::check_for($crate::detect::Feature::$feature)
+                    $crate::detect::check_for($crate::detect::Feature::$feature)
                 }
             )*
         }