@@ -532,16 +532,6 @@ impl<'a, 'b:'a, 'tcx:'b> GraphBuilder<'a, 'b, 'tcx> {
532
532
}
533
533
}
534
534
535
- /// Ensures that the reduced graph rooted at the given external module
536
- /// is built, building it if it is not.
537
- fn populate_module_if_necessary ( & mut self , module : Module < ' b > ) {
538
- if module. populated . get ( ) { return }
539
- for child in self . session . cstore . item_children ( module. def_id ( ) . unwrap ( ) ) {
540
- self . build_reduced_graph_for_external_crate_def ( module, child) ;
541
- }
542
- module. populated . set ( true )
543
- }
544
-
545
535
/// Builds the reduced graph rooted at the 'use' directive for an external
546
536
/// crate.
547
537
fn build_reduced_graph_for_external_crate ( & mut self , root : Module < ' b > ) {
@@ -585,6 +575,19 @@ impl<'a, 'b:'a, 'tcx:'b> GraphBuilder<'a, 'b, 'tcx> {
585
575
}
586
576
}
587
577
578
+ impl < ' a , ' tcx > Resolver < ' a , ' tcx > {
579
+ /// Ensures that the reduced graph rooted at the given external module
580
+ /// is built, building it if it is not.
581
+ pub fn populate_module_if_necessary ( & mut self , module : Module < ' a > ) {
582
+ if module. populated . get ( ) { return }
583
+ let mut builder = GraphBuilder { resolver : self } ;
584
+ for child in self . session . cstore . item_children ( module. def_id ( ) . unwrap ( ) ) {
585
+ builder. build_reduced_graph_for_external_crate_def ( module, child) ;
586
+ }
587
+ module. populated . set ( true )
588
+ }
589
+ }
590
+
588
591
struct BuildReducedGraphVisitor < ' a , ' b : ' a , ' tcx : ' b > {
589
592
builder : GraphBuilder < ' a , ' b , ' tcx > ,
590
593
parent : Module < ' b > ,
@@ -617,8 +620,3 @@ impl<'a, 'b, 'v, 'tcx> Visitor<'v> for BuildReducedGraphVisitor<'a, 'b, 'tcx> {
617
620
pub fn build_reduced_graph ( resolver : & mut Resolver , krate : & hir:: Crate ) {
618
621
GraphBuilder { resolver : resolver } . build_reduced_graph ( krate) ;
619
622
}
620
-
621
- pub fn populate_module_if_necessary < ' a , ' tcx > ( resolver : & mut Resolver < ' a , ' tcx > ,
622
- module : Module < ' a > ) {
623
- GraphBuilder { resolver : resolver } . populate_module_if_necessary ( module) ;
624
- }
0 commit comments