We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 676d042 commit f9886deCopy full SHA for f9886de
compiler/rustc_borrowck/src/type_check/mod.rs
@@ -243,6 +243,22 @@ pub(crate) fn type_check<'mir, 'tcx>(
243
hidden_type.ty = Ty::new_error(infcx.tcx, reported);
244
}
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
+
262
(opaque_type_key, hidden_type)
263
})
264
.collect();
0 commit comments