@@ -145,8 +145,6 @@ pub struct ConstStability {
145
145
pub feature : Symbol ,
146
146
/// whether the function has a `#[rustc_promotable]` attribute
147
147
pub promotable : bool ,
148
- /// whether the function has a `#[rustc_allow_const_fn_ptr]` attribute
149
- pub allow_const_fn_ptr : bool ,
150
148
}
151
149
152
150
/// The available stability levels.
@@ -190,7 +188,6 @@ where
190
188
let mut stab: Option < Stability > = None ;
191
189
let mut const_stab: Option < ConstStability > = None ;
192
190
let mut promotable = false ;
193
- let mut allow_const_fn_ptr = false ;
194
191
let diagnostic = & sess. parse_sess . span_diagnostic ;
195
192
196
193
' outer: for attr in attrs_iter {
@@ -200,7 +197,6 @@ where
200
197
sym:: unstable,
201
198
sym:: stable,
202
199
sym:: rustc_promotable,
203
- sym:: rustc_allow_const_fn_ptr,
204
200
]
205
201
. iter ( )
206
202
. any ( |& s| attr. has_name ( s) )
@@ -215,9 +211,6 @@ where
215
211
if attr. has_name ( sym:: rustc_promotable) {
216
212
promotable = true ;
217
213
}
218
- if attr. has_name ( sym:: rustc_allow_const_fn_ptr) {
219
- allow_const_fn_ptr = true ;
220
- }
221
214
// attributes with data
222
215
else if let Some ( MetaItem { kind : MetaItemKind :: List ( ref metas) , .. } ) = meta {
223
216
let meta = meta. as_ref ( ) . unwrap ( ) ;
@@ -360,12 +353,8 @@ where
360
353
if sym:: unstable == meta_name {
361
354
stab = Some ( Stability { level, feature } ) ;
362
355
} 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 } ) ;
369
358
}
370
359
}
371
360
( None , _, _) => {
@@ -440,12 +429,8 @@ where
440
429
if sym:: stable == meta_name {
441
430
stab = Some ( Stability { level, feature } ) ;
442
431
} 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 } ) ;
449
434
}
450
435
}
451
436
( None , _) => {
@@ -464,18 +449,16 @@ where
464
449
}
465
450
466
451
// Merge the const-unstable info into the stability info
467
- if promotable || allow_const_fn_ptr {
452
+ if promotable {
468
453
if let Some ( ref mut stab) = const_stab {
469
454
stab. promotable = promotable;
470
- stab. allow_const_fn_ptr = allow_const_fn_ptr;
471
455
} else {
472
456
struct_span_err ! (
473
457
diagnostic,
474
458
item_sp,
475
459
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"
479
462
)
480
463
. emit ( ) ;
481
464
}
0 commit comments