Skip to content

Commit 6dd2ea0

Browse files
committed
features must be additive
1 parent 5b50069 commit 6dd2ea0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

compiler/rustc_codegen_ssa/src/target_features.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,12 @@ impl Stability {
5151
// When adding features to the below lists
5252
// check whether they're named already elsewhere in rust
5353
// e.g. in stdarch and whether the given name matches LLVM's
54-
// if it doesn't, to_llvm_feature in llvm_util in rustc_codegen_llvm needs to be adapted
54+
// if it doesn't, to_llvm_feature in llvm_util in rustc_codegen_llvm needs to be adapted.
55+
//
56+
// Also note that all target features listed here must be purely additive: for target_feature 1.1 to
57+
// be sound, we can never allow features like `+soft-float` (on x86) to be controlled on a
58+
// per-function level, since we would then allow safe calls from functions with `+soft-float` to
59+
// functions without that feature!
5560
//
5661
// When adding a new feature, be particularly mindful of features that affect function ABIs. Those
5762
// need to be treated very carefully to avoid introducing unsoundness! This often affects features

0 commit comments

Comments
 (0)