about summary refs log tree commit diff
path: root/compiler/rustc_target/src/spec/mod.rs
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2024-11-24 12:35:50 +0100
committerRalf Jung <post@ralfj.de>2024-12-14 08:24:18 +0100
commit1f8236d4c78fc111da14f4e00639e92ca05707de (patch)
treee844b4caac5af4a3b63d990006c1e559a67490da /compiler/rustc_target/src/spec/mod.rs
parenteb2e928250066df9e40291fb9fb97308df16046e (diff)
downloadrust-1f8236d4c78fc111da14f4e00639e92ca05707de.tar.gz
rust-1f8236d4c78fc111da14f4e00639e92ca05707de.zip
reject aarch64 target feature toggling that would change the float ABI
Diffstat (limited to 'compiler/rustc_target/src/spec/mod.rs')
-rw-r--r--compiler/rustc_target/src/spec/mod.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs
index 7d308c6c662..06d2099a446 100644
--- a/compiler/rustc_target/src/spec/mod.rs
+++ b/compiler/rustc_target/src/spec/mod.rs
@@ -2615,6 +2615,18 @@ impl TargetOptions {
             }
         })
     }
+
+    pub(crate) fn has_neg_feature(&self, search_feature: &str) -> bool {
+        self.features.split(',').any(|f| {
+            if let Some(f) = f.strip_prefix('-')
+                && f == search_feature
+            {
+                true
+            } else {
+                false
+            }
+        })
+    }
 }
 
 impl Default for TargetOptions {