@@ -239,8 +239,7 @@ pub fn resolve_interior<'a, 'tcx>(
239
239
// typeck had previously found constraints that would cause them to be related.
240
240
241
241
let mut counter = 0 ;
242
- let mut mk_bound_region = |span| {
243
- let kind = ty:: BrAnon ( span) ;
242
+ let mut mk_bound_region = |kind| {
244
243
let var = ty:: BoundVar :: from_u32 ( counter) ;
245
244
counter += 1 ;
246
245
ty:: BoundRegion { var, kind }
@@ -252,24 +251,24 @@ pub fn resolve_interior<'a, 'tcx>(
252
251
let origin = fcx. region_var_origin ( vid) ;
253
252
match origin {
254
253
RegionVariableOrigin :: EarlyBoundRegion ( span, _) => {
255
- mk_bound_region ( Some ( span) )
254
+ mk_bound_region ( ty :: BrAnon ( Some ( span) ) )
256
255
}
257
- _ => mk_bound_region ( None ) ,
256
+ _ => mk_bound_region ( ty :: BrAnon ( None ) ) ,
258
257
}
259
258
}
260
259
// FIXME: these should use `BrNamed`
261
260
ty:: ReEarlyBound ( region) => {
262
- mk_bound_region ( Some ( fcx. tcx . def_span ( region. def_id ) ) )
261
+ mk_bound_region ( ty :: BrAnon ( Some ( fcx. tcx . def_span ( region. def_id ) ) ) )
263
262
}
264
263
ty:: ReLateBound ( _, ty:: BoundRegion { kind, .. } )
265
264
| ty:: ReFree ( ty:: FreeRegion { bound_region : kind, .. } ) => match kind {
266
- ty:: BoundRegionKind :: BrAnon ( span) => mk_bound_region ( span) ,
265
+ ty:: BoundRegionKind :: BrAnon ( span) => mk_bound_region ( ty :: BrAnon ( span) ) ,
267
266
ty:: BoundRegionKind :: BrNamed ( def_id, _) => {
268
- mk_bound_region ( Some ( fcx. tcx . def_span ( def_id) ) )
267
+ mk_bound_region ( ty :: BrAnon ( Some ( fcx. tcx . def_span ( def_id) ) ) )
269
268
}
270
- ty:: BoundRegionKind :: BrEnv => mk_bound_region ( None ) ,
269
+ ty:: BoundRegionKind :: BrEnv => mk_bound_region ( ty :: BrAnon ( None ) ) ,
271
270
} ,
272
- _ => mk_bound_region ( None ) ,
271
+ _ => mk_bound_region ( ty :: BrAnon ( None ) ) ,
273
272
} ;
274
273
let r = fcx. tcx . mk_re_late_bound ( current_depth, br) ;
275
274
r
0 commit comments