@@ -145,8 +145,6 @@ pub struct ConstStability {
145145 pub feature : Symbol ,
146146 /// whether the function has a `#[rustc_promotable]` attribute
147147 pub promotable : bool ,
148- /// whether the function has a `#[rustc_allow_const_fn_ptr]` attribute
149- pub allow_const_fn_ptr : bool ,
150148}
151149
152150/// The available stability levels.
@@ -190,7 +188,6 @@ where
190188 let mut stab: Option < Stability > = None ;
191189 let mut const_stab: Option < ConstStability > = None ;
192190 let mut promotable = false ;
193- let mut allow_const_fn_ptr = false ;
194191 let diagnostic = & sess. parse_sess . span_diagnostic ;
195192
196193 ' outer: for attr in attrs_iter {
@@ -200,7 +197,6 @@ where
200197 sym:: unstable,
201198 sym:: stable,
202199 sym:: rustc_promotable,
203- sym:: rustc_allow_const_fn_ptr,
204200 ]
205201 . iter ( )
206202 . any ( |& s| attr. has_name ( s) )
@@ -215,9 +211,6 @@ where
215211 if attr. has_name ( sym:: rustc_promotable) {
216212 promotable = true ;
217213 }
218- if attr. has_name ( sym:: rustc_allow_const_fn_ptr) {
219- allow_const_fn_ptr = true ;
220- }
221214 // attributes with data
222215 else if let Some ( MetaItem { kind : MetaItemKind :: List ( ref metas) , .. } ) = meta {
223216 let meta = meta. as_ref ( ) . unwrap ( ) ;
@@ -360,12 +353,8 @@ where
360353 if sym:: unstable == meta_name {
361354 stab = Some ( Stability { level, feature } ) ;
362355 } else {
363- const_stab = Some ( ConstStability {
364- level,
365- feature,
366- promotable : false ,
367- allow_const_fn_ptr : false ,
368- } ) ;
356+ const_stab =
357+ Some ( ConstStability { level, feature, promotable : false } ) ;
369358 }
370359 }
371360 ( None , _, _) => {
@@ -440,12 +429,8 @@ where
440429 if sym:: stable == meta_name {
441430 stab = Some ( Stability { level, feature } ) ;
442431 } else {
443- const_stab = Some ( ConstStability {
444- level,
445- feature,
446- promotable : false ,
447- allow_const_fn_ptr : false ,
448- } ) ;
432+ const_stab =
433+ Some ( ConstStability { level, feature, promotable : false } ) ;
449434 }
450435 }
451436 ( None , _) => {
@@ -464,18 +449,16 @@ where
464449 }
465450
466451 // Merge the const-unstable info into the stability info
467- if promotable || allow_const_fn_ptr {
452+ if promotable {
468453 if let Some ( ref mut stab) = const_stab {
469454 stab. promotable = promotable;
470- stab. allow_const_fn_ptr = allow_const_fn_ptr;
471455 } else {
472456 struct_span_err ! (
473457 diagnostic,
474458 item_sp,
475459 E0717 ,
476- "rustc_promotable and rustc_allow_const_fn_ptr attributes \
477- must be paired with either a rustc_const_unstable or a rustc_const_stable \
478- attribute"
460+ "`rustc_promotable` attribute must be paired with either a `rustc_const_unstable` \
461+ or a `rustc_const_stable` attribute"
479462 )
480463 . emit ( ) ;
481464 }
0 commit comments