@@ -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 >) ] = & [
@@ -354,6 +361,10 @@ declare_features! (
354
361
( removed, pushpop_unsafe, "1.2.0" , None ) ,
355
362
) ;
356
363
364
+ declare_features ! (
365
+ ( stable_removed, no_stack_check, "1.0.0" , None ) ,
366
+ ) ;
367
+
357
368
declare_features ! (
358
369
( accepted, associated_types, "1.0.0" , None ) ,
359
370
// allow overloading augmented assignment operations like `a += b`
@@ -508,9 +519,6 @@ pub const BUILTIN_ATTRIBUTES: &'static [(&'static str, AttributeType, AttributeG
508
519
not yet settled",
509
520
cfg_fn ! ( structural_match) ) ) ,
510
521
511
- // Not used any more, but we can't feature gate it
512
- ( "no_stack_check" , Normal , Ungated ) ,
513
-
514
522
( "plugin" , CrateLevel , Gated ( Stability :: Unstable ,
515
523
"plugin" ,
516
524
"compiler plugins are experimental \
@@ -912,8 +920,10 @@ fn find_lang_feature_issue(feature: &str) -> Option<u32> {
912
920
// assert!(issue.is_some())
913
921
issue
914
922
} else {
915
- // search in Accepted or Removed features
916
- match ACCEPTED_FEATURES . iter ( ) . chain ( REMOVED_FEATURES ) . find ( |t| t. 0 == feature) {
923
+ // search in Accepted, Removed, or Stable Removed features
924
+ let found = ACCEPTED_FEATURES . iter ( ) . chain ( REMOVED_FEATURES ) . chain ( STABLE_REMOVED_FEATURES )
925
+ . find ( |t| t. 0 == feature) ;
926
+ match found {
917
927
Some ( & ( _, _, issue) ) => issue,
918
928
None => panic ! ( "Feature `{}` is not declared anywhere" , feature) ,
919
929
}
@@ -1451,7 +1461,9 @@ pub fn get_features(span_handler: &Handler, krate_attrs: &[ast::Attribute]) -> F
1451
1461
feature_checker. collect ( & features, mi. span ) ;
1452
1462
}
1453
1463
else if let Some ( & ( _, _, _) ) = REMOVED_FEATURES . iter ( )
1454
- . find ( |& & ( n, _, _) | name == n) {
1464
+ . find ( |& & ( n, _, _) | name == n)
1465
+ . or_else ( || STABLE_REMOVED_FEATURES . iter ( )
1466
+ . find ( |& & ( n, _, _) | name == n) ) {
1455
1467
span_err ! ( span_handler, mi. span, E0557 , "feature has been removed" ) ;
1456
1468
}
1457
1469
else if let Some ( & ( _, _, _) ) = ACCEPTED_FEATURES . iter ( )
0 commit comments