@@ -19,7 +19,7 @@ use crate::errors;
1919pub ( crate ) fn from_target_feature_attr (
2020 tcx : TyCtxt < ' _ > ,
2121 attr : & hir:: Attribute ,
22- rust_target_features : & UnordMap < String , target_features:: StabilityComputed > ,
22+ rust_target_features : & UnordMap < String , target_features:: Stability > ,
2323 target_features : & mut Vec < TargetFeature > ,
2424) {
2525 let Some ( list) = attr. meta_item_list ( ) else { return } ;
@@ -64,7 +64,7 @@ pub(crate) fn from_target_feature_attr(
6464
6565 // Only allow target features whose feature gates have been enabled
6666 // 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 ( ) {
6868 tcx. dcx ( ) . emit_err ( errors:: ForbiddenTargetFeatureAttr {
6969 span : item. span ( ) ,
7070 feature,
@@ -141,19 +141,18 @@ pub(crate) fn provide(providers: &mut Providers) {
141141 * providers = Providers {
142142 rust_target_features : |tcx, cnum| {
143143 assert_eq ! ( cnum, LOCAL_CRATE ) ;
144- let target = & tcx. sess . target ;
145144 if tcx. sess . opts . actually_rustdoc {
146145 // rustdoc needs to be able to document functions that use all the features, so
147146 // whitelist them all
148147 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) )
150149 . collect ( )
151150 } else {
152151 tcx. sess
153152 . target
154153 . rust_target_features ( )
155154 . iter ( )
156- . map ( |( a, b, _) | ( a. to_string ( ) , b . compute_toggleability ( target ) ) )
155+ . map ( |( a, b, _) | ( a. to_string ( ) , * b ) )
157156 . collect ( )
158157 }
159158 } ,
0 commit comments