Remove u32 on BoundTyKind::Anon
This commit is contained in:
parent
f0edcc8a6f
commit
b15195a304
7 changed files with 17 additions and 23 deletions
|
@ -302,7 +302,7 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for Canonicalizer<'_, 'tcx> {
|
|||
universe: placeholder.universe,
|
||||
bound: ty::BoundTy {
|
||||
var: ty::BoundVar::from_usize(self.variables.len()),
|
||||
kind: ty::BoundTyKind::Anon(self.variables.len() as u32),
|
||||
kind: ty::BoundTyKind::Anon,
|
||||
},
|
||||
}),
|
||||
CanonicalizeMode::Response { .. } => CanonicalVarKind::PlaceholderTy(placeholder),
|
||||
|
@ -312,7 +312,7 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for Canonicalizer<'_, 'tcx> {
|
|||
universe: ty::UniverseIndex::ROOT,
|
||||
bound: ty::BoundTy {
|
||||
var: ty::BoundVar::from_usize(self.variables.len()),
|
||||
kind: ty::BoundTyKind::Anon(self.variables.len() as u32),
|
||||
kind: ty::BoundTyKind::Anon,
|
||||
},
|
||||
}),
|
||||
CanonicalizeMode::Response { .. } => bug!("param ty in response: {t:?}"),
|
||||
|
@ -351,7 +351,7 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for Canonicalizer<'_, 'tcx> {
|
|||
var
|
||||
}),
|
||||
);
|
||||
let bt = ty::BoundTy { var, kind: BoundTyKind::Anon(var.index() as u32) };
|
||||
let bt = ty::BoundTy { var, kind: BoundTyKind::Anon };
|
||||
self.interner().mk_bound(self.binder_index, bt)
|
||||
}
|
||||
|
||||
|
|
|
@ -95,17 +95,15 @@ fn replace_erased_lifetimes_with_bound_vars<'tcx>(
|
|||
let mut counter = 0;
|
||||
let ty = tcx.fold_regions(ty, |mut r, current_depth| {
|
||||
if let ty::ReErased = r.kind() {
|
||||
let br = ty::BoundRegion {
|
||||
var: ty::BoundVar::from_u32(counter),
|
||||
kind: ty::BrAnon(counter, None),
|
||||
};
|
||||
let br =
|
||||
ty::BoundRegion { var: ty::BoundVar::from_u32(counter), kind: ty::BrAnon(None) };
|
||||
counter += 1;
|
||||
r = tcx.mk_re_late_bound(current_depth, br);
|
||||
}
|
||||
r
|
||||
});
|
||||
let bound_vars = tcx.mk_bound_variable_kinds_from_iter(
|
||||
(0..counter).map(|i| ty::BoundVariableKind::Region(ty::BrAnon(i, None))),
|
||||
(0..counter).map(|_| ty::BoundVariableKind::Region(ty::BrAnon(None))),
|
||||
);
|
||||
ty::Binder::bind_with_vars(ty, bound_vars)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue