@@ -47,9 +47,9 @@ pub(crate) fn global_gcc_features(sess: &Session, diagnostics: bool) -> Vec<Stri
47
47
48
48
// Ensure that all ABI-required features are enabled, and the ABI-forbidden ones
49
49
// are disabled.
50
- let ( abi_enable , abi_disable ) = sess. target . abi_required_features ( ) ;
51
- let abi_enable_set = FxHashSet :: from_iter ( abi_enable . iter ( ) . copied ( ) ) ;
52
- let abi_disable_set = FxHashSet :: from_iter ( abi_disable . iter ( ) . copied ( ) ) ;
50
+ let abi_feature_constraints = sess. target . abi_required_features ( ) ;
51
+ let abi_incompatible_set =
52
+ FxHashSet :: from_iter ( abi_feature_constraints . incompatible . iter ( ) . copied ( ) ) ;
53
53
54
54
// Compute implied features
55
55
let mut all_rust_features = vec ! [ ] ;
@@ -72,7 +72,7 @@ pub(crate) fn global_gcc_features(sess: &Session, diagnostics: bool) -> Vec<Stri
72
72
}
73
73
}
74
74
}
75
- // Remove features that are meant for rustc, not LLVM .
75
+ // Remove features that are meant for rustc, not codegen .
76
76
all_rust_features. retain ( |( _, feature) | {
77
77
// Retain if it is not a rustc feature
78
78
!RUSTC_SPECIFIC_FEATURES . contains ( feature)
@@ -121,7 +121,7 @@ pub(crate) fn global_gcc_features(sess: &Session, diagnostics: bool) -> Vec<Stri
121
121
122
122
// Ensure that the features we enable/disable are compatible with the ABI.
123
123
if enable {
124
- if abi_disable_set . contains ( feature) {
124
+ if abi_incompatible_set . contains ( feature) {
125
125
sess. dcx ( ) . emit_warn ( ForbiddenCTargetFeature {
126
126
feature,
127
127
enabled : "enabled" ,
@@ -131,8 +131,7 @@ pub(crate) fn global_gcc_features(sess: &Session, diagnostics: bool) -> Vec<Stri
131
131
} else {
132
132
// FIXME: we have to request implied features here since
133
133
// negative features do not handle implied features above.
134
- #[ allow( rustc:: potential_query_instability) ] // order does not matter
135
- for & required in abi_enable_set. iter ( ) {
134
+ for & required in abi_feature_constraints. required . iter ( ) {
136
135
let implied = sess. target . implied_target_features ( std:: iter:: once ( required) ) ;
137
136
if implied. contains ( feature) {
138
137
sess. dcx ( ) . emit_warn ( ForbiddenCTargetFeature {
@@ -158,7 +157,11 @@ pub(crate) fn global_gcc_features(sess: &Session, diagnostics: bool) -> Vec<Stri
158
157
// still override it... that's unsound, but more compatible with past behavior.
159
158
all_rust_features. splice (
160
159
0 ..0 ,
161
- abi_enable. iter ( ) . map ( |& f| ( true , f) ) . chain ( abi_disable. iter ( ) . map ( |& f| ( false , f) ) ) ,
160
+ abi_feature_constraints
161
+ . required
162
+ . iter ( )
163
+ . map ( |& f| ( true , f) )
164
+ . chain ( abi_feature_constraints. incompatible . iter ( ) . map ( |& f| ( false , f) ) ) ,
162
165
) ;
163
166
164
167
// Translate this into GCC features.
0 commit comments