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
|
@ -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 { .. } => {
|
||||
|
|
|
@ -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
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue