@@ -3,7 +3,7 @@ use super::accepted::ACCEPTED_FEATURES;
3
3
use super :: removed:: { REMOVED_FEATURES , STABLE_REMOVED_FEATURES } ;
4
4
use super :: builtin_attrs:: { AttributeGate , BUILTIN_ATTRIBUTE_MAP } ;
5
5
6
- use crate :: ast:: { self , NodeId , PatKind , RangeEnd , VariantData } ;
6
+ use crate :: ast:: { self , NodeId , GenericParam , GenericParamKind , PatKind , RangeEnd , VariantData } ;
7
7
use crate :: attr:: { self , check_builtin_attribute} ;
8
8
use crate :: source_map:: Spanned ;
9
9
use crate :: edition:: { ALL_EDITIONS , Edition } ;
@@ -594,6 +594,16 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
594
594
visit:: walk_fn ( self , fn_kind, fn_decl, span)
595
595
}
596
596
597
+ fn visit_generic_param ( & mut self , param : & ' a GenericParam ) {
598
+ match param. kind {
599
+ GenericParamKind :: Const { .. } =>
600
+ gate_feature_post ! ( & self , const_generics, param. ident. span,
601
+ "const generics are unstable" ) ,
602
+ _ => { }
603
+ }
604
+ visit:: walk_generic_param ( self , param)
605
+ }
606
+
597
607
fn visit_trait_item ( & mut self , ti : & ' a ast:: TraitItem ) {
598
608
match ti. kind {
599
609
ast:: TraitItemKind :: Method ( ref sig, ref block) => {
0 commit comments