1
Fork 0

Auto merge of #110036 - jackh726:placeholder_boundvar, r=nnethercote

Remove u32 on BrAnon and BoundTyKind::Anon in favor of BoundVar on Placeholder types

r? `@nnethercote`

Better alternative to #110025
This commit is contained in:
bors 2023-04-07 14:26:24 +00:00
commit 94524020ea
47 changed files with 204 additions and 200 deletions

View file

@ -2336,10 +2336,10 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
FnMutDelegate {
regions: &mut |_| tcx.lifetimes.re_erased,
types: &mut |bv| {
tcx.mk_placeholder(ty::PlaceholderType { universe, name: bv.kind })
tcx.mk_placeholder(ty::PlaceholderType { universe, bound: bv })
},
consts: &mut |bv, ty| {
tcx.mk_const(ty::PlaceholderConst { universe, name: bv }, ty)
tcx.mk_const(ty::PlaceholderConst { universe, bound: bv }, ty)
},
},
);
@ -2525,11 +2525,11 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
regions: &mut |_| tcx.lifetimes.re_erased,
types: &mut |bv| tcx.mk_placeholder(ty::PlaceholderType {
universe,
name: bv.kind,
bound: bv,
}),
consts: &mut |bv, ty| tcx.mk_const(ty::PlaceholderConst {
universe,
name: bv
bound: bv,
}, ty),
})
)

View file

@ -139,14 +139,14 @@ pub fn check_intrinsic_type(tcx: TyCtxt<'_>, it: &hir::ForeignItem<'_>) {
let name_str = intrinsic_name.as_str();
let bound_vars = tcx.mk_bound_variable_kinds(&[
ty::BoundVariableKind::Region(ty::BrAnon(0, None)),
ty::BoundVariableKind::Region(ty::BrAnon(None)),
ty::BoundVariableKind::Region(ty::BrEnv),
]);
let mk_va_list_ty = |mutbl| {
tcx.lang_items().va_list().map(|did| {
let region = tcx.mk_re_late_bound(
ty::INNERMOST,
ty::BoundRegion { var: ty::BoundVar::from_u32(0), kind: ty::BrAnon(0, None) },
ty::BoundRegion { var: ty::BoundVar::from_u32(0), kind: ty::BrAnon(None) },
);
let env_region = tcx.mk_re_late_bound(
ty::INNERMOST,
@ -387,8 +387,7 @@ pub fn check_intrinsic_type(tcx: TyCtxt<'_>, it: &hir::ForeignItem<'_>) {
);
let discriminant_def_id = assoc_items[0];
let br =
ty::BoundRegion { var: ty::BoundVar::from_u32(0), kind: ty::BrAnon(0, None) };
let br = ty::BoundRegion { var: ty::BoundVar::from_u32(0), kind: ty::BrAnon(None) };
(
1,
vec![tcx.mk_imm_ref(tcx.mk_re_late_bound(ty::INNERMOST, br), param(0))],
@ -440,8 +439,7 @@ pub fn check_intrinsic_type(tcx: TyCtxt<'_>, it: &hir::ForeignItem<'_>) {
sym::nontemporal_store => (1, vec![tcx.mk_mut_ptr(param(0)), param(0)], tcx.mk_unit()),
sym::raw_eq => {
let br =
ty::BoundRegion { var: ty::BoundVar::from_u32(0), kind: ty::BrAnon(0, None) };
let br = ty::BoundRegion { var: ty::BoundVar::from_u32(0), kind: ty::BrAnon(None) };
let param_ty = tcx.mk_imm_ref(tcx.mk_re_late_bound(ty::INNERMOST, br), param(0));
(1, vec![param_ty; 2], tcx.types.bool)
}