@@ -19,7 +19,7 @@ use crate::errors;
19
19
pub ( crate ) fn from_target_feature_attr (
20
20
tcx : TyCtxt < ' _ > ,
21
21
attr : & hir:: Attribute ,
22
- rust_target_features : & UnordMap < String , target_features:: StabilityComputed > ,
22
+ rust_target_features : & UnordMap < String , target_features:: Stability > ,
23
23
target_features : & mut Vec < TargetFeature > ,
24
24
) {
25
25
let Some ( list) = attr. meta_item_list ( ) else { return } ;
@@ -64,7 +64,7 @@ pub(crate) fn from_target_feature_attr(
64
64
65
65
// Only allow target features whose feature gates have been enabled
66
66
// and which are permitted to be toggled.
67
- if let Err ( reason) = stability. toggle_allowed ( /*enable*/ true ) {
67
+ if let Err ( reason) = stability. toggle_allowed ( ) {
68
68
tcx. dcx ( ) . emit_err ( errors:: ForbiddenTargetFeatureAttr {
69
69
span : item. span ( ) ,
70
70
feature,
@@ -141,19 +141,18 @@ pub(crate) fn provide(providers: &mut Providers) {
141
141
* providers = Providers {
142
142
rust_target_features : |tcx, cnum| {
143
143
assert_eq ! ( cnum, LOCAL_CRATE ) ;
144
- let target = & tcx. sess . target ;
145
144
if tcx. sess . opts . actually_rustdoc {
146
145
// rustdoc needs to be able to document functions that use all the features, so
147
146
// whitelist them all
148
147
rustc_target:: target_features:: all_rust_features ( )
149
- . map ( |( a, b) | ( a. to_string ( ) , b. compute_toggleability ( target ) ) )
148
+ . map ( |( a, b) | ( a. to_string ( ) , b) )
150
149
. collect ( )
151
150
} else {
152
151
tcx. sess
153
152
. target
154
153
. rust_target_features ( )
155
154
. iter ( )
156
- . map ( |( a, b, _) | ( a. to_string ( ) , b . compute_toggleability ( target ) ) )
155
+ . map ( |( a, b, _) | ( a. to_string ( ) , * b ) )
157
156
. collect ( )
158
157
}
159
158
} ,
0 commit comments