@@ -647,8 +647,6 @@ impl<'a, 'b> BuildReducedGraphVisitor<'a, 'b> {
647
647
self . r . define ( parent, ident, TypeNS , imported_binding) ;
648
648
}
649
649
650
- ItemKind :: GlobalAsm ( ..) => { }
651
-
652
650
ItemKind :: Mod ( ..) if ident. name == kw:: Invalid => { } // Crate root
653
651
654
652
ItemKind :: Mod ( ..) => {
@@ -667,9 +665,6 @@ impl<'a, 'b> BuildReducedGraphVisitor<'a, 'b> {
667
665
self . parent_scope . module = module;
668
666
}
669
667
670
- // Handled in `rustc_metadata::{native_libs,link_args}`
671
- ItemKind :: ForeignMod ( ..) => { }
672
-
673
668
// These items live in the value namespace.
674
669
ItemKind :: Static ( ..) => {
675
670
let res = Res :: Def ( DefKind :: Static , self . r . definitions . local_def_id ( item. id ) ) ;
@@ -765,12 +760,6 @@ impl<'a, 'b> BuildReducedGraphVisitor<'a, 'b> {
765
760
self . insert_field_names_local ( def_id, vdata) ;
766
761
}
767
762
768
- ItemKind :: Impl ( .., ref impl_items) => {
769
- for impl_item in impl_items {
770
- self . resolve_visibility ( & impl_item. vis ) ;
771
- }
772
- }
773
-
774
763
ItemKind :: Trait ( ..) => {
775
764
let def_id = self . r . definitions . local_def_id ( item. id ) ;
776
765
@@ -785,6 +774,9 @@ impl<'a, 'b> BuildReducedGraphVisitor<'a, 'b> {
785
774
self . parent_scope . module = module;
786
775
}
787
776
777
+ // These items do not add names to modules.
778
+ ItemKind :: Impl ( ..) | ItemKind :: ForeignMod ( ..) | ItemKind :: GlobalAsm ( ..) => { }
779
+
788
780
ItemKind :: MacroDef ( ..) | ItemKind :: Mac ( _) => unreachable ! ( ) ,
789
781
}
790
782
}
@@ -1118,7 +1110,6 @@ macro_rules! method {
1118
1110
}
1119
1111
1120
1112
impl < ' a , ' b > Visitor < ' b > for BuildReducedGraphVisitor < ' a , ' b > {
1121
- method ! ( visit_impl_item: ast:: ImplItem , ast:: ImplItemKind :: Macro , walk_impl_item) ;
1122
1113
method ! ( visit_expr: ast:: Expr , ast:: ExprKind :: Mac , walk_expr) ;
1123
1114
method ! ( visit_pat: ast:: Pat , ast:: PatKind :: Mac , walk_pat) ;
1124
1115
method ! ( visit_ty: ast:: Ty , ast:: TyKind :: Mac , walk_ty) ;
@@ -1202,6 +1193,15 @@ impl<'a, 'b> Visitor<'b> for BuildReducedGraphVisitor<'a, 'b> {
1202
1193
visit:: walk_trait_item ( self , item) ;
1203
1194
}
1204
1195
1196
+ fn visit_impl_item ( & mut self , item : & ' b ast:: ImplItem ) {
1197
+ if let ast:: ImplItemKind :: Macro ( ..) = item. kind {
1198
+ self . visit_invoc ( item. id ) ;
1199
+ } else {
1200
+ self . resolve_visibility ( & item. vis ) ;
1201
+ visit:: walk_impl_item ( self , item) ;
1202
+ }
1203
+ }
1204
+
1205
1205
fn visit_token ( & mut self , t : Token ) {
1206
1206
if let token:: Interpolated ( nt) = t. kind {
1207
1207
if let token:: NtExpr ( ref expr) = * nt {
0 commit comments