@@ -577,42 +577,38 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
577
577
if block. is_none ( ) {
578
578
self . check_extern ( sig. header . ext ) ;
579
579
}
580
- if sig. decl . c_variadic ( ) {
581
- gate_feature_post ! ( & self , c_variadic, ti. span,
582
- "C-variadic functions are unstable" ) ;
583
- }
584
580
if sig. header . constness . node == ast:: Constness :: Const {
585
581
gate_feature_post ! ( & self , const_fn, ti. span, "const fn is unstable" ) ;
586
582
}
587
583
}
588
584
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
+ ) ;
593
590
}
594
- self . check_gat ( & ti. generics , ti. span ) ;
595
591
}
596
592
_ => { }
597
593
}
598
- visit:: walk_assoc_item ( self , ti)
594
+ visit:: walk_trait_item ( self , ti)
599
595
}
600
596
601
- fn visit_impl_item ( & mut self , ii : & ' a ast:: ImplItem ) {
597
+ fn visit_assoc_item ( & mut self , ii : & ' a ast:: AssocItem ) {
602
598
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" ) ;
606
600
}
607
601
608
602
match ii. kind {
609
- ast:: ImplItemKind :: Method ( ref sig, _) => {
603
+ ast:: AssocItemKind :: Method ( ref sig, _) => {
610
604
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
+ ) ;
613
609
}
614
610
}
615
- ast:: ImplItemKind :: TyAlias ( _, ref ty) => {
611
+ ast:: AssocItemKind :: TyAlias ( _, ref ty) => {
616
612
if let Some ( ty) = ty {
617
613
self . check_impl_trait ( ty) ;
618
614
}
0 commit comments