@@ -19,7 +19,6 @@ use resolve_imports::ImportDirectiveSubclass::{self, SingleImport, GlobImport};
19
19
use Module ;
20
20
use Namespace :: { self , TypeNS , ValueNS } ;
21
21
use { NameBinding , NameBindingKind } ;
22
- use module_to_string;
23
22
use ParentLink :: { ModuleParentLink , BlockParentLink } ;
24
23
use Resolver ;
25
24
use { resolve_error, resolve_struct_error, ResolutionError } ;
@@ -547,34 +546,14 @@ impl<'a, 'b:'a, 'tcx:'b> GraphBuilder<'a, 'b, 'tcx> {
547
546
}
548
547
}
549
548
550
- /// Builds the reduced graph rooted at the given external module.
551
- fn populate_external_module ( & mut self , module : Module < ' b > ) {
552
- debug ! ( "(populating external module) attempting to populate {}" ,
553
- module_to_string( module) ) ;
554
-
555
- let def_id = match module. def_id ( ) {
556
- None => {
557
- debug ! ( "(populating external module) ... no def ID!" ) ;
558
- return ;
559
- }
560
- Some ( def_id) => def_id,
561
- } ;
562
-
563
- for child in self . session . cstore . item_children ( def_id) {
564
- debug ! ( "(populating external module) ... found ident: {}" ,
565
- child. name) ;
566
- self . build_reduced_graph_for_external_crate_def ( module, child) ;
567
- }
568
- module. populated . set ( true )
569
- }
570
-
571
549
/// Ensures that the reduced graph rooted at the given external module
572
550
/// is built, building it if it is not.
573
551
fn populate_module_if_necessary ( & mut self , module : Module < ' b > ) {
574
- if !module. populated . get ( ) {
575
- self . populate_external_module ( module)
552
+ if module. populated . get ( ) { return }
553
+ for child in self . session . cstore . item_children ( module. def_id ( ) . unwrap ( ) ) {
554
+ self . build_reduced_graph_for_external_crate_def ( module, child) ;
576
555
}
577
- assert ! ( module. populated. get ( ) )
556
+ module. populated . set ( true )
578
557
}
579
558
580
559
/// Builds the reduced graph rooted at the 'use' directive for an external
0 commit comments