resolve to universal regions when possible

This commit is contained in:
Ali MJ Al-Nasrawy 2023-02-16 14:40:53 +03:00
parent 13471d3b20
commit f3dfa52fd1
4 changed files with 19 additions and 38 deletions

View file

@ -871,12 +871,12 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for PlaceholderReplacer<'_, 'tcx> {
fn fold_region(&mut self, r0: ty::Region<'tcx>) -> ty::Region<'tcx> {
let r1 = match *r0 {
ty::ReVar(_) => self
ty::ReVar(vid) => self
.infcx
.inner
.borrow_mut()
.unwrap_region_constraints()
.opportunistic_resolve_region(self.infcx.tcx, r0),
.opportunistic_resolve_var(self.infcx.tcx, vid),
_ => r0,
};