File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
compiler/rustc_borrowck/src/type_check Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -243,6 +243,22 @@ pub(crate) fn type_check<'mir, 'tcx>(
243
243
hidden_type. ty = Ty :: new_error ( infcx. tcx , reported) ;
244
244
}
245
245
246
+ // Convert all regions to nll vars.
247
+ let ( opaque_type_key, hidden_type) =
248
+ infcx. tcx . fold_regions ( ( opaque_type_key, hidden_type) , |region, _| {
249
+ match region. kind ( ) {
250
+ ty:: ReVar ( _) => region,
251
+ ty:: RePlaceholder ( placeholder) => checker
252
+ . borrowck_context
253
+ . constraints
254
+ . placeholder_region ( infcx, placeholder) ,
255
+ _ => ty:: Region :: new_var (
256
+ infcx. tcx ,
257
+ checker. borrowck_context . universal_regions . to_region_vid ( region) ,
258
+ ) ,
259
+ }
260
+ } ) ;
261
+
246
262
( opaque_type_key, hidden_type)
247
263
} )
248
264
. collect ( ) ;
You can’t perform that action at this time.
0 commit comments