1
Fork 0

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:
Nicholas Nethercote 2023-02-13 13:03:45 +11:00
parent 7439028374
commit cef9004f5a
39 changed files with 196 additions and 173 deletions

View file

@ -1103,7 +1103,7 @@ impl<'tcx> InferCtxt<'tcx> {
) -> ty::Region<'tcx> {
let region_var =
self.inner.borrow_mut().unwrap_region_constraints().new_region_var(universe, origin);
self.tcx.mk_region(ty::ReVar(region_var))
self.tcx.mk_re_var(region_var)
}
/// Return the universe that the region `r` was created in. For