@@ -577,42 +577,38 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
577577 if block. is_none ( ) {
578578 self . check_extern ( sig. header . ext ) ;
579579 }
580- if sig. decl . c_variadic ( ) {
581- gate_feature_post ! ( & self , c_variadic, ti. span,
582- "C-variadic functions are unstable" ) ;
583- }
584580 if sig. header . constness . node == ast:: Constness :: Const {
585581 gate_feature_post ! ( & self , const_fn, ti. span, "const fn is unstable" ) ;
586582 }
587583 }
588584 ast:: TraitItemKind :: TyAlias ( _, ref default) => {
589- if let Some ( ty) = default {
590- self . check_impl_trait ( ty) ;
591- gate_feature_post ! ( & self , associated_type_defaults, ti. span,
592- "associated type defaults are unstable" ) ;
585+ if let Some ( _) = default {
586+ gate_feature_post ! (
587+ & self , associated_type_defaults, ti. span,
588+ "associated type defaults are unstable"
589+ ) ;
593590 }
594- self . check_gat ( & ti. generics , ti. span ) ;
595591 }
596592 _ => { }
597593 }
598- visit:: walk_assoc_item ( self , ti)
594+ visit:: walk_trait_item ( self , ti)
599595 }
600596
601- fn visit_impl_item ( & mut self , ii : & ' a ast:: ImplItem ) {
597+ fn visit_assoc_item ( & mut self , ii : & ' a ast:: AssocItem ) {
602598 if ii. defaultness == ast:: Defaultness :: Default {
603- gate_feature_post ! ( & self , specialization,
604- ii. span,
605- "specialization is unstable" ) ;
599+ gate_feature_post ! ( & self , specialization, ii. span, "specialization is unstable" ) ;
606600 }
607601
608602 match ii. kind {
609- ast:: ImplItemKind :: Method ( ref sig, _) => {
603+ ast:: AssocItemKind :: Method ( ref sig, _) => {
610604 if sig. decl . c_variadic ( ) {
611- gate_feature_post ! ( & self , c_variadic, ii. span,
612- "C-variadic functions are unstable" ) ;
605+ gate_feature_post ! (
606+ & self , c_variadic, ii. span,
607+ "C-variadic functions are unstable"
608+ ) ;
613609 }
614610 }
615- ast:: ImplItemKind :: TyAlias ( _, ref ty) => {
611+ ast:: AssocItemKind :: TyAlias ( _, ref ty) => {
616612 if let Some ( ty) = ty {
617613 self . check_impl_trait ( ty) ;
618614 }
0 commit comments