Skip to content

Commit 7196973

Browse files
Remove chalk lowering for AliasTy
1 parent 0f9e414 commit 7196973

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

compiler/rustc_traits/src/chalk/lowering.rs

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,6 @@ impl<'tcx> LowerInto<'tcx, SubstsRef<'tcx>> for &chalk_ir::Substitution<RustInte
6666
}
6767
}
6868

69-
impl<'tcx> LowerInto<'tcx, chalk_ir::AliasTy<RustInterner<'tcx>>> for ty::AliasTy<'tcx> {
70-
fn lower_into(self, interner: RustInterner<'tcx>) -> chalk_ir::AliasTy<RustInterner<'tcx>> {
71-
chalk_ir::AliasTy::Projection(chalk_ir::ProjectionTy {
72-
associated_ty_id: chalk_ir::AssocTypeId(self.def_id),
73-
substitution: self.substs.lower_into(interner),
74-
})
75-
}
76-
}
77-
7869
impl<'tcx> LowerInto<'tcx, chalk_ir::InEnvironment<chalk_ir::Goal<RustInterner<'tcx>>>>
7970
for ChalkEnvironmentAndGoal<'tcx>
8071
{
@@ -255,7 +246,10 @@ impl<'tcx> LowerInto<'tcx, chalk_ir::AliasEq<RustInterner<'tcx>>>
255246
// FIXME(associated_const_equality): teach chalk about terms for alias eq.
256247
chalk_ir::AliasEq {
257248
ty: self.term.ty().unwrap().lower_into(interner),
258-
alias: self.projection_ty.lower_into(interner),
249+
alias: chalk_ir::AliasTy::Projection(chalk_ir::ProjectionTy {
250+
associated_ty_id: chalk_ir::AssocTypeId(self.projection_ty.def_id),
251+
substitution: self.projection_ty.substs.lower_into(interner),
252+
}),
259253
}
260254
}
261255
}
@@ -353,7 +347,12 @@ impl<'tcx> LowerInto<'tcx, chalk_ir::Ty<RustInterner<'tcx>>> for Ty<'tcx> {
353347
ty::Tuple(types) => {
354348
chalk_ir::TyKind::Tuple(types.len(), types.as_substs().lower_into(interner))
355349
}
356-
ty::Alias(ty::Projection, proj) => chalk_ir::TyKind::Alias(proj.lower_into(interner)),
350+
ty::Alias(ty::Projection, ty::AliasTy { def_id, substs }) => {
351+
chalk_ir::TyKind::Alias(chalk_ir::AliasTy::Projection(chalk_ir::ProjectionTy {
352+
associated_ty_id: chalk_ir::AssocTypeId(def_id),
353+
substitution: substs.lower_into(interner),
354+
}))
355+
}
357356
ty::Alias(ty::Opaque, ty::AliasTy { def_id, substs }) => {
358357
chalk_ir::TyKind::Alias(chalk_ir::AliasTy::Opaque(chalk_ir::OpaqueTy {
359358
opaque_ty_id: chalk_ir::OpaqueTyId(def_id),

0 commit comments

Comments
 (0)