@@ -728,9 +728,10 @@ impl<'a, 'b> BuildReducedGraphVisitor<'a, 'b> {
728
728
expansion,
729
729
item. span ) ;
730
730
self . r . define ( parent, ident, TypeNS , ( module, vis, sp, expansion) ) ;
731
+ self . parent_scope . module = module;
731
732
732
733
for variant in & ( * enum_definition) . variants {
733
- self . build_reduced_graph_for_variant ( variant, module , vis) ;
734
+ self . build_reduced_graph_for_variant ( variant, vis) ;
734
735
}
735
736
}
736
737
@@ -818,10 +819,8 @@ impl<'a, 'b> BuildReducedGraphVisitor<'a, 'b> {
818
819
819
820
// Constructs the reduced graph for one variant. Variants exist in the
820
821
// type and value namespaces.
821
- fn build_reduced_graph_for_variant ( & mut self ,
822
- variant : & Variant ,
823
- parent : Module < ' a > ,
824
- vis : ty:: Visibility ) {
822
+ fn build_reduced_graph_for_variant ( & mut self , variant : & Variant , vis : ty:: Visibility ) {
823
+ let parent = self . parent_scope . module ;
825
824
let expn_id = self . parent_scope . expansion ;
826
825
let ident = variant. ident ;
827
826
@@ -1253,9 +1252,7 @@ impl<'a, 'b> Visitor<'b> for BuildReducedGraphVisitor<'a, 'b> {
1253
1252
let expansion = self . parent_scope . expansion ;
1254
1253
self . r . define ( parent, item. ident , ns, ( res, vis, item. span , expansion) ) ;
1255
1254
1256
- self . parent_scope . module = parent. parent . unwrap ( ) ; // nearest normal ancestor
1257
1255
visit:: walk_trait_item ( self , item) ;
1258
- self . parent_scope . module = parent;
1259
1256
}
1260
1257
1261
1258
fn visit_token ( & mut self , t : Token ) {
0 commit comments