@@ -27,7 +27,7 @@ use self::AttributeGate::*;
27
27
28
28
use rustc_data_structures:: fx:: FxHashMap ;
29
29
use rustc_target:: spec:: abi:: Abi ;
30
- use ast:: { self , NodeId , PatKind , RangeEnd } ;
30
+ use ast:: { self , NodeId , PatKind , RangeEnd , GenericParam , GenericParamKind } ;
31
31
use attr;
32
32
use source_map:: Spanned ;
33
33
use edition:: { ALL_EDITIONS , Edition } ;
@@ -429,6 +429,9 @@ declare_features! (
429
429
// `existential type`
430
430
( active, existential_type, "1.28.0" , Some ( 34511 ) , None ) ,
431
431
432
+ // const generic types
433
+ ( active, const_generics, "1.29.0" , Some ( 44580 ) , None ) ,
434
+
432
435
// unstable #[target_feature] directives
433
436
( active, arm_target_feature, "1.27.0" , Some ( 44839 ) , None ) ,
434
437
( active, aarch64_target_feature, "1.27.0" , Some ( 44839 ) , None ) ,
@@ -1818,6 +1821,14 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
1818
1821
visit:: walk_fn ( self , fn_kind, fn_decl, span) ;
1819
1822
}
1820
1823
1824
+ fn visit_generic_param ( & mut self , param : & ' a GenericParam ) {
1825
+ if let GenericParamKind :: Const { .. } = param. kind {
1826
+ gate_feature_post ! ( & self , const_generics, param. ident. span,
1827
+ "const generics are unstable" ) ;
1828
+ }
1829
+ visit:: walk_generic_param ( self , param) ;
1830
+ }
1831
+
1821
1832
fn visit_trait_item ( & mut self , ti : & ' a ast:: TraitItem ) {
1822
1833
match ti. node {
1823
1834
ast:: TraitItemKind :: Method ( ref sig, ref block) => {
0 commit comments