@@ -136,6 +136,8 @@ pub(crate) fn type_check<'mir, 'tcx>(
136
136
upvars : & [ Upvar < ' tcx > ] ,
137
137
) -> MirTypeckResults < ' tcx > {
138
138
let implicit_region_bound = infcx. tcx . mk_region ( ty:: ReVar ( universal_regions. fr_fn_body ) ) ;
139
+ let mut universe_causes = FxHashMap :: default ( ) ;
140
+ universe_causes. insert ( ty:: UniverseIndex :: from_u32 ( 0 ) , UniverseInfo :: other ( ) ) ;
139
141
let mut constraints = MirTypeckRegionConstraints {
140
142
placeholder_indices : PlaceholderIndices :: default ( ) ,
141
143
placeholder_index_to_region : IndexVec :: default ( ) ,
@@ -144,7 +146,7 @@ pub(crate) fn type_check<'mir, 'tcx>(
144
146
member_constraints : MemberConstraintSet :: default ( ) ,
145
147
closure_bounds_mapping : Default :: default ( ) ,
146
148
type_tests : Vec :: default ( ) ,
147
- universe_causes : IndexVec :: from_elem_n ( UniverseInfo :: other ( ) , 1 ) ,
149
+ universe_causes,
148
150
} ;
149
151
150
152
let CreateResult {
@@ -159,9 +161,9 @@ pub(crate) fn type_check<'mir, 'tcx>(
159
161
& mut constraints,
160
162
) ;
161
163
162
- for _ in ty:: UniverseIndex :: ROOT ..infcx. universe ( ) {
164
+ for u in ty:: UniverseIndex :: ROOT ..infcx. universe ( ) {
163
165
let info = UniverseInfo :: other ( ) ;
164
- constraints. universe_causes . push ( info) ;
166
+ constraints. universe_causes . insert ( u , info) ;
165
167
}
166
168
167
169
let mut borrowck_context = BorrowCheckContext {
@@ -924,7 +926,7 @@ crate struct MirTypeckRegionConstraints<'tcx> {
924
926
crate closure_bounds_mapping :
925
927
FxHashMap < Location , FxHashMap < ( RegionVid , RegionVid ) , ( ConstraintCategory , Span ) > > ,
926
928
927
- crate universe_causes : IndexVec < ty:: UniverseIndex , UniverseInfo < ' tcx > > ,
929
+ crate universe_causes : FxHashMap < ty:: UniverseIndex , UniverseInfo < ' tcx > > ,
928
930
929
931
crate type_tests : Vec < TypeTest < ' tcx > > ,
930
932
}
0 commit comments