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

@ -540,13 +540,13 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
let kind = ty::BoundRegionKind::BrNamed(param.def_id, param.name);
let bound_var = ty::BoundVariableKind::Region(kind);
bound_vars.push(bound_var);
tcx.mk_region(ty::ReLateBound(
tcx.mk_re_late_bound(
ty::INNERMOST,
ty::BoundRegion {
var: ty::BoundVar::from_usize(bound_vars.len() - 1),
kind,
},
))
)
.into()
}
GenericParamDefKind::Const { .. } => {

View file

@ -3023,7 +3023,7 @@ fn bind_generator_hidden_types_above<'tcx>(
kind: ty::BrAnon(counter, None),
};
counter += 1;
r = tcx.mk_region(ty::ReLateBound(current_depth, br));
r = tcx.mk_re_late_bound(current_depth, br);
}
r
})