Use BoundTy and BoundRegion instead of kind of PlaceholderTy and PlaceholderRegion

This commit is contained in:
Jack Huey
2023-04-06 21:12:17 -04:00
parent c934ce9e0a
commit 4646b3df6a
20 changed files with 121 additions and 75 deletions

View File

@@ -300,14 +300,20 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for Canonicalizer<'_, 'tcx> {
ty::Placeholder(placeholder) => match self.canonicalize_mode {
CanonicalizeMode::Input => CanonicalVarKind::PlaceholderTy(ty::Placeholder {
universe: placeholder.universe,
name: BoundTyKind::Anon(self.variables.len() as u32),
bound: ty::BoundTy {
var: ty::BoundVar::from_usize(self.variables.len()),
kind: ty::BoundTyKind::Anon(self.variables.len() as u32),
},
}),
CanonicalizeMode::Response { .. } => CanonicalVarKind::PlaceholderTy(placeholder),
},
ty::Param(_) => match self.canonicalize_mode {
CanonicalizeMode::Input => CanonicalVarKind::PlaceholderTy(ty::Placeholder {
universe: ty::UniverseIndex::ROOT,
name: ty::BoundTyKind::Anon(self.variables.len() as u32),
bound: ty::BoundTy {
var: ty::BoundVar::from_usize(self.variables.len()),
kind: ty::BoundTyKind::Anon(self.variables.len() as u32),
},
}),
CanonicalizeMode::Response { .. } => bug!("param ty in response: {t:?}"),
},
@@ -373,7 +379,7 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for Canonicalizer<'_, 'tcx> {
CanonicalizeMode::Input => CanonicalVarKind::PlaceholderConst(
ty::Placeholder {
universe: placeholder.universe,
name: ty::BoundVar::from(self.variables.len()),
bound: ty::BoundVar::from(self.variables.len()),
},
c.ty(),
),
@@ -385,7 +391,7 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for Canonicalizer<'_, 'tcx> {
CanonicalizeMode::Input => CanonicalVarKind::PlaceholderConst(
ty::Placeholder {
universe: ty::UniverseIndex::ROOT,
name: ty::BoundVar::from(self.variables.len()),
bound: ty::BoundVar::from(self.variables.len()),
},
c.ty(),
),