@@ -215,11 +215,7 @@ where
215
215
// In Rust, `#[macro_export]` macros are unconditionally visible at the
216
216
// crate root, even if the parent modules is **not** visible.
217
217
if export {
218
- self . update (
219
- self . def_map . root ,
220
- None ,
221
- & [ ( name, Resolution { def : PerNs :: macros ( macro_) } ) ] ,
222
- ) ;
218
+ self . update ( self . def_map . root , & [ ( name, Resolution { def : PerNs :: macros ( macro_) } ) ] ) ;
223
219
}
224
220
}
225
221
@@ -373,7 +369,7 @@ where
373
369
// Module scoped macros is included
374
370
let items = scope. collect_resolutions ( ) ;
375
371
376
- self . update ( module_id, Some ( import_id ) , & items) ;
372
+ self . update ( module_id, & items) ;
377
373
} else {
378
374
// glob import from same crate => we do an initial
379
375
// import, and then need to propagate any further
@@ -383,7 +379,7 @@ where
383
379
// Module scoped macros is included
384
380
let items = scope. collect_resolutions ( ) ;
385
381
386
- self . update ( module_id, Some ( import_id ) , & items) ;
382
+ self . update ( module_id, & items) ;
387
383
// record the glob import in case we add further items
388
384
let glob = self . glob_imports . entry ( m. local_id ) . or_default ( ) ;
389
385
if !glob. iter ( ) . any ( |it| * it == ( module_id, import_id) ) {
@@ -406,7 +402,7 @@ where
406
402
( name, res)
407
403
} )
408
404
. collect :: < Vec < _ > > ( ) ;
409
- self . update ( module_id, Some ( import_id ) , & resolutions) ;
405
+ self . update ( module_id, & resolutions) ;
410
406
}
411
407
Some ( d) => {
412
408
log:: debug!( "glob import {:?} from non-module/enum {:?}" , import, d) ;
@@ -429,26 +425,20 @@ where
429
425
}
430
426
431
427
let resolution = Resolution { def } ;
432
- self . update ( module_id, Some ( import_id ) , & [ ( name, resolution) ] ) ;
428
+ self . update ( module_id, & [ ( name, resolution) ] ) ;
433
429
}
434
430
None => tested_by ! ( bogus_paths) ,
435
431
}
436
432
}
437
433
}
438
434
439
- fn update (
440
- & mut self ,
441
- module_id : LocalModuleId ,
442
- import : Option < raw:: Import > ,
443
- resolutions : & [ ( Name , Resolution ) ] ,
444
- ) {
445
- self . update_recursive ( module_id, import, resolutions, 0 )
435
+ fn update ( & mut self , module_id : LocalModuleId , resolutions : & [ ( Name , Resolution ) ] ) {
436
+ self . update_recursive ( module_id, resolutions, 0 )
446
437
}
447
438
448
439
fn update_recursive (
449
440
& mut self ,
450
441
module_id : LocalModuleId ,
451
- import : Option < raw:: Import > ,
452
442
resolutions : & [ ( Name , Resolution ) ] ,
453
443
depth : usize ,
454
444
) {
@@ -459,7 +449,7 @@ where
459
449
let scope = & mut self . def_map . modules [ module_id] . scope ;
460
450
let mut changed = false ;
461
451
for ( name, res) in resolutions {
462
- changed |= scope. push_res ( name. clone ( ) , res, import . is_some ( ) ) ;
452
+ changed |= scope. push_res ( name. clone ( ) , res) ;
463
453
}
464
454
465
455
if !changed {
@@ -472,9 +462,9 @@ where
472
462
. flat_map ( |v| v. iter ( ) )
473
463
. cloned ( )
474
464
. collect :: < Vec < _ > > ( ) ;
475
- for ( glob_importing_module, glob_import ) in glob_imports {
465
+ for ( glob_importing_module, _glob_import ) in glob_imports {
476
466
// We pass the glob import so that the tracked import in those modules is that glob import
477
- self . update_recursive ( glob_importing_module, Some ( glob_import ) , resolutions, depth + 1 ) ;
467
+ self . update_recursive ( glob_importing_module, resolutions, depth + 1 ) ;
478
468
}
479
469
}
480
470
@@ -716,7 +706,7 @@ where
716
706
let def: ModuleDefId = module. into ( ) ;
717
707
self . def_collector . def_map . modules [ self . module_id ] . scope . define_def ( def) ;
718
708
let resolution = Resolution { def : def. into ( ) } ;
719
- self . def_collector . update ( self . module_id , None , & [ ( name, resolution) ] ) ;
709
+ self . def_collector . update ( self . module_id , & [ ( name, resolution) ] ) ;
720
710
res
721
711
}
722
712
@@ -776,7 +766,7 @@ where
776
766
} ;
777
767
self . def_collector . def_map . modules [ self . module_id ] . scope . define_def ( def) ;
778
768
let resolution = Resolution { def : def. into ( ) } ;
779
- self . def_collector . update ( self . module_id , None , & [ ( name, resolution) ] )
769
+ self . def_collector . update ( self . module_id , & [ ( name, resolution) ] )
780
770
}
781
771
782
772
fn collect_derives ( & mut self , attrs : & Attrs , def : & raw:: DefData ) {
0 commit comments