@@ -77,12 +77,19 @@ macro_rules! declare_features {
77
77
} ;
78
78
79
79
( $( ( removed, $feature: ident, $ver: expr, $issue: expr) , ) +) => {
80
- /// Represents features which has since been removed (it was once Active)
80
+ /// Represents unstable features which have since been removed (it was once Active)
81
81
const REMOVED_FEATURES : & ' static [ ( & ' static str , & ' static str , Option <u32 >) ] = & [
82
82
$( ( stringify!( $feature) , $ver, $issue) ) ,+
83
83
] ;
84
84
} ;
85
85
86
+ ( $( ( stable_removed, $feature: ident, $ver: expr, $issue: expr) , ) +) => {
87
+ /// Represents stable features which have since been removed (it was once Accepted)
88
+ const STABLE_REMOVED_FEATURES : & ' static [ ( & ' static str , & ' static str , Option <u32 >) ] = & [
89
+ $( ( stringify!( $feature) , $ver, $issue) ) ,+
90
+ ] ;
91
+ } ;
92
+
86
93
( $( ( accepted, $feature: ident, $ver: expr, $issue: expr) , ) +) => {
87
94
/// Those language feature has since been Accepted (it was once Active)
88
95
const ACCEPTED_FEATURES : & ' static [ ( & ' static str , & ' static str , Option <u32 >) ] = & [
@@ -351,6 +358,10 @@ declare_features! (
351
358
( removed, pushpop_unsafe, "1.2.0" , None ) ,
352
359
) ;
353
360
361
+ declare_features ! (
362
+ ( stable_removed, no_stack_check, "1.0.0" , None ) ,
363
+ ) ;
364
+
354
365
declare_features ! (
355
366
( accepted, associated_types, "1.0.0" , None ) ,
356
367
// allow overloading augmented assignment operations like `a += b`
@@ -505,9 +516,6 @@ pub const BUILTIN_ATTRIBUTES: &'static [(&'static str, AttributeType, AttributeG
505
516
not yet settled",
506
517
cfg_fn ! ( structural_match) ) ) ,
507
518
508
- // Not used any more, but we can't feature gate it
509
- ( "no_stack_check" , Normal , Ungated ) ,
510
-
511
519
( "plugin" , CrateLevel , Gated ( Stability :: Unstable ,
512
520
"plugin" ,
513
521
"compiler plugins are experimental \
@@ -909,8 +917,10 @@ fn find_lang_feature_issue(feature: &str) -> Option<u32> {
909
917
// assert!(issue.is_some())
910
918
issue
911
919
} else {
912
- // search in Accepted or Removed features
913
- match ACCEPTED_FEATURES . iter ( ) . chain ( REMOVED_FEATURES ) . find ( |t| t. 0 == feature) {
920
+ // search in Accepted, Removed, or Stable Removed features
921
+ let found = ACCEPTED_FEATURES . iter ( ) . chain ( REMOVED_FEATURES ) . chain ( STABLE_REMOVED_FEATURES )
922
+ . find ( |t| t. 0 == feature) ;
923
+ match found {
914
924
Some ( & ( _, _, issue) ) => issue,
915
925
None => panic ! ( "Feature `{}` is not declared anywhere" , feature) ,
916
926
}
@@ -1444,7 +1454,9 @@ pub fn get_features(span_handler: &Handler, krate_attrs: &[ast::Attribute]) -> F
1444
1454
feature_checker. collect ( & features, mi. span ) ;
1445
1455
}
1446
1456
else if let Some ( & ( _, _, _) ) = REMOVED_FEATURES . iter ( )
1447
- . find ( |& & ( n, _, _) | name == n) {
1457
+ . find ( |& & ( n, _, _) | name == n)
1458
+ . or_else ( || STABLE_REMOVED_FEATURES . iter ( )
1459
+ . find ( |& & ( n, _, _) | name == n) ) {
1448
1460
span_err ! ( span_handler, mi. span, E0557 , "feature has been removed" ) ;
1449
1461
}
1450
1462
else if let Some ( & ( _, _, _) ) = ACCEPTED_FEATURES . iter ( )
0 commit comments