@@ -658,8 +658,6 @@ impl<'a, 'b> BuildReducedGraphVisitor<'a, 'b> {
658
658
self . r . define ( parent, ident, TypeNS , imported_binding) ;
659
659
}
660
660
661
- ItemKind :: GlobalAsm ( ..) => { }
662
-
663
661
ItemKind :: Mod ( ..) if ident. name == kw:: Invalid => { } // Crate root
664
662
665
663
ItemKind :: Mod ( ..) => {
@@ -678,9 +676,6 @@ impl<'a, 'b> BuildReducedGraphVisitor<'a, 'b> {
678
676
self . parent_scope . module = module;
679
677
}
680
678
681
- // Handled in `rustc_metadata::{native_libs,link_args}`
682
- ItemKind :: ForeignMod ( ..) => { }
683
-
684
679
// These items live in the value namespace.
685
680
ItemKind :: Static ( ..) => {
686
681
let res = Res :: Def ( DefKind :: Static , self . r . definitions . local_def_id ( item. id ) ) ;
@@ -781,12 +776,6 @@ impl<'a, 'b> BuildReducedGraphVisitor<'a, 'b> {
781
776
self . insert_field_names ( item_def_id, field_names) ;
782
777
}
783
778
784
- ItemKind :: Impl ( .., ref impl_items) => {
785
- for impl_item in impl_items {
786
- self . resolve_visibility ( & impl_item. vis ) ;
787
- }
788
- }
789
-
790
779
ItemKind :: Trait ( ..) => {
791
780
let def_id = self . r . definitions . local_def_id ( item. id ) ;
792
781
@@ -801,6 +790,9 @@ impl<'a, 'b> BuildReducedGraphVisitor<'a, 'b> {
801
790
self . parent_scope . module = module;
802
791
}
803
792
793
+ // These items do not add names to modules.
794
+ ItemKind :: Impl ( ..) | ItemKind :: ForeignMod ( ..) | ItemKind :: GlobalAsm ( ..) => { }
795
+
804
796
ItemKind :: MacroDef ( ..) | ItemKind :: Mac ( _) => unreachable ! ( ) ,
805
797
}
806
798
}
@@ -1134,7 +1126,6 @@ macro_rules! method {
1134
1126
}
1135
1127
1136
1128
impl < ' a , ' b > Visitor < ' b > for BuildReducedGraphVisitor < ' a , ' b > {
1137
- method ! ( visit_impl_item: ast:: ImplItem , ast:: ImplItemKind :: Macro , walk_impl_item) ;
1138
1129
method ! ( visit_expr: ast:: Expr , ast:: ExprKind :: Mac , walk_expr) ;
1139
1130
method ! ( visit_pat: ast:: Pat , ast:: PatKind :: Mac , walk_pat) ;
1140
1131
method ! ( visit_ty: ast:: Ty , ast:: TyKind :: Mac , walk_ty) ;
@@ -1218,6 +1209,15 @@ impl<'a, 'b> Visitor<'b> for BuildReducedGraphVisitor<'a, 'b> {
1218
1209
visit:: walk_trait_item ( self , item) ;
1219
1210
}
1220
1211
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
+
1221
1221
fn visit_token ( & mut self , t : Token ) {
1222
1222
if let token:: Interpolated ( nt) = t. kind {
1223
1223
if let token:: NtExpr ( ref expr) = * nt {
0 commit comments