about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/src
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2023-11-13 09:41:45 +0100
committerRalf Jung <post@ralfj.de>2023-11-13 09:41:45 +0100
commit6dd2ea0f35e0e30bf52b481971d039a18f96eef1 (patch)
tree4dc9452b6a93ace936a96b3f1dbca4e2f40d1f07 /compiler/rustc_codegen_ssa/src
parent5b5006916bfdebf2a96f0b4491828390e8ed68b5 (diff)
downloadrust-6dd2ea0f35e0e30bf52b481971d039a18f96eef1.tar.gz
rust-6dd2ea0f35e0e30bf52b481971d039a18f96eef1.zip
features must be additive
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
-rw-r--r--compiler/rustc_codegen_ssa/src/target_features.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_ssa/src/target_features.rs b/compiler/rustc_codegen_ssa/src/target_features.rs
index 8973042401f..d802816bb75 100644
--- a/compiler/rustc_codegen_ssa/src/target_features.rs
+++ b/compiler/rustc_codegen_ssa/src/target_features.rs
@@ -51,7 +51,12 @@ impl Stability {
 // When adding features to the below lists
 // check whether they're named already elsewhere in rust
 // e.g. in stdarch and whether the given name matches LLVM's
-// if it doesn't, to_llvm_feature in llvm_util in rustc_codegen_llvm needs to be adapted
+// if it doesn't, to_llvm_feature in llvm_util in rustc_codegen_llvm needs to be adapted.
+//
+// Also note that all target features listed here must be purely additive: for target_feature 1.1 to
+// be sound, we can never allow features like `+soft-float` (on x86) to be controlled on a
+// per-function level, since we would then allow safe calls from functions with `+soft-float` to
+// functions without that feature!
 //
 // When adding a new feature, be particularly mindful of features that affect function ABIs. Those
 // need to be treated very carefully to avoid introducing unsoundness! This often affects features