@@ -48,22 +48,25 @@ pub(crate) struct ImportResolver<'r, 'ra, 'tcx> {
48
48
49
49
// outputs
50
50
determined_imports : Vec < Import < ' ra > > ,
51
+ glob_imports : Vec < Import < ' ra > > ,
51
52
}
52
53
53
54
struct ImportResolutionOutputs < ' ra > {
54
55
indeterminate_imports : Vec < Import < ' ra > > ,
55
56
determined_imports : Vec < Import < ' ra > > ,
57
+ glob_imports : Vec < Import < ' ra > > ,
56
58
}
57
59
58
60
impl < ' r , ' ra , ' tcx > ImportResolver < ' r , ' ra , ' tcx > {
59
61
pub ( crate ) fn new ( cmr : CmResolver < ' r , ' ra , ' tcx > , batch : Vec < Import < ' ra > > ) -> Self {
60
- ImportResolver { r : cmr, batch, determined_imports : Vec :: new ( ) }
62
+ ImportResolver { r : cmr, batch, determined_imports : Vec :: new ( ) , glob_imports : Vec :: new ( ) }
61
63
}
62
64
63
65
fn into_outputs ( self ) -> ImportResolutionOutputs < ' ra > {
64
66
ImportResolutionOutputs {
65
67
indeterminate_imports : self . batch ,
66
68
determined_imports : self . determined_imports ,
69
+ glob_imports : self . glob_imports ,
67
70
}
68
71
}
69
72
}
@@ -72,6 +75,9 @@ impl<'ra> ImportResolutionOutputs<'ra> {
72
75
fn commit < ' tcx > ( self , r : & mut Resolver < ' ra , ' tcx > ) {
73
76
r. indeterminate_imports = self . indeterminate_imports ;
74
77
r. determined_imports . extend ( self . determined_imports ) ;
78
+ for glob in self . glob_imports {
79
+ r. resolve_glob_import ( glob) ;
80
+ }
75
81
}
76
82
}
77
83
@@ -927,9 +933,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
927
933
( source, target, bindings, type_ns_only)
928
934
}
929
935
ImportKind :: Glob { .. } => {
930
- // FIXME: Use mutable resolver directly as a hack, this should be an output of
931
- // specualtive resolution.
932
- self . r . get_mut_unchecked ( ) . resolve_glob_import ( import) ;
936
+ self . glob_imports . push ( import) ;
933
937
return 0 ;
934
938
}
935
939
_ => unreachable ! ( ) ,
0 commit comments