@@ -362,15 +362,6 @@ impl<'a> LoweringContext<'a> {
362362 }
363363
364364 impl < ' lcx , ' interner > Visitor < ' lcx > for MiscCollector < ' lcx , ' interner > {
365- fn visit_mod ( & mut self , m : & ' lcx Mod , _s : Span , _attrs : & [ Attribute ] , n : NodeId ) {
366- self . lctx . modules . insert ( n, hir:: ModuleItems {
367- items : BTreeSet :: new ( ) ,
368- trait_items : BTreeSet :: new ( ) ,
369- impl_items : BTreeSet :: new ( ) ,
370- } ) ;
371- visit:: walk_mod ( self , m) ;
372- }
373-
374365 fn visit_item ( & mut self , item : & ' lcx Item ) {
375366 self . lctx . allocate_hir_id_counter ( item. id , item) ;
376367
@@ -430,6 +421,12 @@ impl<'a> LoweringContext<'a> {
430421
431422 impl < ' lcx , ' interner > Visitor < ' lcx > for ItemLowerer < ' lcx , ' interner > {
432423 fn visit_mod ( & mut self , m : & ' lcx Mod , _s : Span , _attrs : & [ Attribute ] , n : NodeId ) {
424+ self . lctx . modules . insert ( n, hir:: ModuleItems {
425+ items : BTreeSet :: new ( ) ,
426+ trait_items : BTreeSet :: new ( ) ,
427+ impl_items : BTreeSet :: new ( ) ,
428+ } ) ;
429+
433430 let old = self . lctx . current_module ;
434431 self . lctx . current_module = n;
435432 visit:: walk_mod ( self , m) ;
0 commit comments