Add specialized variants of mk_region
.
Much like there are specialized variants of `mk_ty`. This will enable some optimization in the next commit. Also rename the existing `re_error*` functions as `mk_re_error*`, for consistency.
This commit is contained in:
parent
7439028374
commit
cef9004f5a
39 changed files with 196 additions and 173 deletions
|
@ -767,7 +767,7 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for BoundVarReplacer<'_, 'tcx> {
|
|||
let universe = self.universe_for(debruijn);
|
||||
let p = ty::PlaceholderRegion { universe, name: br.kind };
|
||||
self.mapped_regions.insert(p, br);
|
||||
self.infcx.tcx.mk_region(ty::RePlaceholder(p))
|
||||
self.infcx.tcx.mk_re_placeholder(p)
|
||||
}
|
||||
_ => r,
|
||||
}
|
||||
|
@ -888,7 +888,7 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for PlaceholderReplacer<'_, 'tcx> {
|
|||
let db = ty::DebruijnIndex::from_usize(
|
||||
self.universe_indices.len() - index + self.current_index.as_usize() - 1,
|
||||
);
|
||||
self.interner().mk_region(ty::ReLateBound(db, *replace_var))
|
||||
self.interner().mk_re_late_bound(db, *replace_var)
|
||||
}
|
||||
None => r1,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue