@@ -658,8 +658,6 @@ impl<'a, 'b> BuildReducedGraphVisitor<'a, 'b> {
658658 self . r . define ( parent, ident, TypeNS , imported_binding) ;
659659 }
660660
661- ItemKind :: GlobalAsm ( ..) => { }
662-
663661 ItemKind :: Mod ( ..) if ident. name == kw:: Invalid => { } // Crate root
664662
665663 ItemKind :: Mod ( ..) => {
@@ -678,9 +676,6 @@ impl<'a, 'b> BuildReducedGraphVisitor<'a, 'b> {
678676 self . parent_scope . module = module;
679677 }
680678
681- // Handled in `rustc_metadata::{native_libs,link_args}`
682- ItemKind :: ForeignMod ( ..) => { }
683-
684679 // These items live in the value namespace.
685680 ItemKind :: Static ( ..) => {
686681 let res = Res :: Def ( DefKind :: Static , self . r . definitions . local_def_id ( item. id ) ) ;
@@ -781,12 +776,6 @@ impl<'a, 'b> BuildReducedGraphVisitor<'a, 'b> {
781776 self . insert_field_names ( item_def_id, field_names) ;
782777 }
783778
784- ItemKind :: Impl ( .., ref impl_items) => {
785- for impl_item in impl_items {
786- self . resolve_visibility ( & impl_item. vis ) ;
787- }
788- }
789-
790779 ItemKind :: Trait ( ..) => {
791780 let def_id = self . r . definitions . local_def_id ( item. id ) ;
792781
@@ -801,6 +790,9 @@ impl<'a, 'b> BuildReducedGraphVisitor<'a, 'b> {
801790 self . parent_scope . module = module;
802791 }
803792
793+ // These items do not add names to modules.
794+ ItemKind :: Impl ( ..) | ItemKind :: ForeignMod ( ..) | ItemKind :: GlobalAsm ( ..) => { }
795+
804796 ItemKind :: MacroDef ( ..) | ItemKind :: Mac ( _) => unreachable ! ( ) ,
805797 }
806798 }
@@ -1134,7 +1126,6 @@ macro_rules! method {
11341126}
11351127
11361128impl < ' a , ' b > Visitor < ' b > for BuildReducedGraphVisitor < ' a , ' b > {
1137- method ! ( visit_impl_item: ast:: ImplItem , ast:: ImplItemKind :: Macro , walk_impl_item) ;
11381129 method ! ( visit_expr: ast:: Expr , ast:: ExprKind :: Mac , walk_expr) ;
11391130 method ! ( visit_pat: ast:: Pat , ast:: PatKind :: Mac , walk_pat) ;
11401131 method ! ( visit_ty: ast:: Ty , ast:: TyKind :: Mac , walk_ty) ;
@@ -1218,6 +1209,15 @@ impl<'a, 'b> Visitor<'b> for BuildReducedGraphVisitor<'a, 'b> {
12181209 visit:: walk_trait_item ( self , item) ;
12191210 }
12201211
1212+ fn visit_impl_item ( & mut self , item : & ' b ast:: ImplItem ) {
1213+ if let ast:: ImplItemKind :: Macro ( ..) = item. kind {
1214+ self . visit_invoc ( item. id ) ;
1215+ } else {
1216+ self . resolve_visibility ( & item. vis ) ;
1217+ visit:: walk_impl_item ( self , item) ;
1218+ }
1219+ }
1220+
12211221 fn visit_token ( & mut self , t : Token ) {
12221222 if let token:: Interpolated ( nt) = t. kind {
12231223 if let token:: NtExpr ( ref expr) = * nt {
0 commit comments