@@ -728,9 +728,10 @@ impl<'a, 'b> BuildReducedGraphVisitor<'a, 'b> {
728728 expansion,
729729 item. span ) ;
730730 self . r . define ( parent, ident, TypeNS , ( module, vis, sp, expansion) ) ;
731+ self . parent_scope . module = module;
731732
732733 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) ;
734735 }
735736 }
736737
@@ -818,10 +819,8 @@ impl<'a, 'b> BuildReducedGraphVisitor<'a, 'b> {
818819
819820 // Constructs the reduced graph for one variant. Variants exist in the
820821 // 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 ;
825824 let expn_id = self . parent_scope . expansion ;
826825 let ident = variant. ident ;
827826
@@ -1253,9 +1252,7 @@ impl<'a, 'b> Visitor<'b> for BuildReducedGraphVisitor<'a, 'b> {
12531252 let expansion = self . parent_scope . expansion ;
12541253 self . r . define ( parent, item. ident , ns, ( res, vis, item. span , expansion) ) ;
12551254
1256- self . parent_scope . module = parent. parent . unwrap ( ) ; // nearest normal ancestor
12571255 visit:: walk_trait_item ( self , item) ;
1258- self . parent_scope . module = parent;
12591256 }
12601257
12611258 fn visit_token ( & mut self , t : Token ) {
0 commit comments