Remove chalk lowering for AliasTy

This commit is contained in:
Michael Goulet 2022-12-06 03:35:47 +00:00
parent 0f9e414092
commit 7196973c3e

View File

@ -66,15 +66,6 @@ impl<'tcx> LowerInto<'tcx, SubstsRef<'tcx>> for &chalk_ir::Substitution<RustInte
} }
} }
impl<'tcx> LowerInto<'tcx, chalk_ir::AliasTy<RustInterner<'tcx>>> for ty::AliasTy<'tcx> {
fn lower_into(self, interner: RustInterner<'tcx>) -> chalk_ir::AliasTy<RustInterner<'tcx>> {
chalk_ir::AliasTy::Projection(chalk_ir::ProjectionTy {
associated_ty_id: chalk_ir::AssocTypeId(self.def_id),
substitution: self.substs.lower_into(interner),
})
}
}
impl<'tcx> LowerInto<'tcx, chalk_ir::InEnvironment<chalk_ir::Goal<RustInterner<'tcx>>>> impl<'tcx> LowerInto<'tcx, chalk_ir::InEnvironment<chalk_ir::Goal<RustInterner<'tcx>>>>
for ChalkEnvironmentAndGoal<'tcx> for ChalkEnvironmentAndGoal<'tcx>
{ {
@ -255,7 +246,10 @@ impl<'tcx> LowerInto<'tcx, chalk_ir::AliasEq<RustInterner<'tcx>>>
// FIXME(associated_const_equality): teach chalk about terms for alias eq. // FIXME(associated_const_equality): teach chalk about terms for alias eq.
chalk_ir::AliasEq { chalk_ir::AliasEq {
ty: self.term.ty().unwrap().lower_into(interner), ty: self.term.ty().unwrap().lower_into(interner),
alias: self.projection_ty.lower_into(interner), alias: chalk_ir::AliasTy::Projection(chalk_ir::ProjectionTy {
associated_ty_id: chalk_ir::AssocTypeId(self.projection_ty.def_id),
substitution: self.projection_ty.substs.lower_into(interner),
}),
} }
} }
} }
@ -353,7 +347,12 @@ impl<'tcx> LowerInto<'tcx, chalk_ir::Ty<RustInterner<'tcx>>> for Ty<'tcx> {
ty::Tuple(types) => { ty::Tuple(types) => {
chalk_ir::TyKind::Tuple(types.len(), types.as_substs().lower_into(interner)) chalk_ir::TyKind::Tuple(types.len(), types.as_substs().lower_into(interner))
} }
ty::Alias(ty::Projection, proj) => chalk_ir::TyKind::Alias(proj.lower_into(interner)), ty::Alias(ty::Projection, ty::AliasTy { def_id, substs }) => {
chalk_ir::TyKind::Alias(chalk_ir::AliasTy::Projection(chalk_ir::ProjectionTy {
associated_ty_id: chalk_ir::AssocTypeId(def_id),
substitution: substs.lower_into(interner),
}))
}
ty::Alias(ty::Opaque, ty::AliasTy { def_id, substs }) => { ty::Alias(ty::Opaque, ty::AliasTy { def_id, substs }) => {
chalk_ir::TyKind::Alias(chalk_ir::AliasTy::Opaque(chalk_ir::OpaqueTy { chalk_ir::TyKind::Alias(chalk_ir::AliasTy::Opaque(chalk_ir::OpaqueTy {
opaque_ty_id: chalk_ir::OpaqueTyId(def_id), opaque_ty_id: chalk_ir::OpaqueTyId(def_id),