@@ -163,8 +163,8 @@ impl<'a> Resolver<'a> {
163163 let def_id = module. def_id ( ) . unwrap ( ) ;
164164 for child in self . cstore . item_children_untracked ( def_id, self . session ) {
165165 let child = child. map_id ( |_| panic ! ( "unexpected id" ) ) ;
166- BuildReducedGraphVisitor { parent_scope : self . dummy_parent_scope ( ) , r : self }
167- . build_reduced_graph_for_external_crate_res ( module , child) ;
166+ BuildReducedGraphVisitor { parent_scope : ParentScope :: default ( module ) , r : self }
167+ . build_reduced_graph_for_external_crate_res ( child) ;
168168 }
169169 module. populated . set ( true )
170170 }
@@ -706,7 +706,7 @@ impl<'a, 'b> BuildReducedGraphVisitor<'a, 'b> {
706706 self . r . define ( parent, ident, TypeNS , ( module, vis, sp, expansion) ) ;
707707
708708 for variant in & ( * enum_definition) . variants {
709- self . build_reduced_graph_for_variant ( variant, module, vis, expansion ) ;
709+ self . build_reduced_graph_for_variant ( variant, module, vis) ;
710710 }
711711 }
712712
@@ -797,8 +797,8 @@ impl<'a, 'b> BuildReducedGraphVisitor<'a, 'b> {
797797 fn build_reduced_graph_for_variant ( & mut self ,
798798 variant : & Variant ,
799799 parent : Module < ' a > ,
800- vis : ty:: Visibility ,
801- expn_id : ExpnId ) {
800+ vis : ty:: Visibility ) {
801+ let expn_id = self . parent_scope . expansion ;
802802 let ident = variant. ident ;
803803
804804 // Define a name in the type namespace.
@@ -861,11 +861,8 @@ impl<'a, 'b> BuildReducedGraphVisitor<'a, 'b> {
861861 }
862862
863863 /// Builds the reduced graph for a single item in an external crate.
864- fn build_reduced_graph_for_external_crate_res (
865- & mut self ,
866- parent : Module < ' a > ,
867- child : Export < ast:: NodeId > ,
868- ) {
864+ fn build_reduced_graph_for_external_crate_res ( & mut self , child : Export < ast:: NodeId > ) {
865+ let parent = self . parent_scope . module ;
869866 let Export { ident, res, vis, span } = child;
870867 // FIXME: We shouldn't create the gensym here, it should come from metadata,
871868 // but metadata cannot encode gensyms currently, so we create it here.
0 commit comments