aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/traits/chalk
diff options
context:
space:
mode:
authorLukas Wirth <[email protected]>2021-03-01 20:57:39 +0000
committerLukas Wirth <[email protected]>2021-03-04 18:38:02 +0000
commit50e01d2bc7429d718e0783d75458a6a047ee2b70 (patch)
tree5043387dfce7e3fc96777ce5983048f0d2d450e5 /crates/hir_ty/src/traits/chalk
parent16a76aa158d0898d6a46d7bba7310150555a69b9 (diff)
Use chalk_ir::AdtId
Diffstat (limited to 'crates/hir_ty/src/traits/chalk')
-rw-r--r--crates/hir_ty/src/traits/chalk/mapping.rs16
1 files changed, 2 insertions, 14 deletions
diff --git a/crates/hir_ty/src/traits/chalk/mapping.rs b/crates/hir_ty/src/traits/chalk/mapping.rs
index db1760e6c..3a08b67e9 100644
--- a/crates/hir_ty/src/traits/chalk/mapping.rs
+++ b/crates/hir_ty/src/traits/chalk/mapping.rs
@@ -86,7 +86,7 @@ impl ToChalk for Ty {
86 86
87 Ty::Adt(adt_id, substs) => { 87 Ty::Adt(adt_id, substs) => {
88 let substitution = substs.to_chalk(db); 88 let substitution = substs.to_chalk(db);
89 chalk_ir::TyKind::Adt(chalk_ir::AdtId(adt_id), substitution).intern(&Interner) 89 chalk_ir::TyKind::Adt(adt_id, substitution).intern(&Interner)
90 } 90 }
91 Ty::Alias(AliasTy::Projection(proj_ty)) => { 91 Ty::Alias(AliasTy::Projection(proj_ty)) => {
92 let associated_ty_id = TypeAliasAsAssocType(proj_ty.associated_ty).to_chalk(db); 92 let associated_ty_id = TypeAliasAsAssocType(proj_ty.associated_ty).to_chalk(db);
@@ -183,7 +183,7 @@ impl ToChalk for Ty {
183 Ty::Dyn(predicates) 183 Ty::Dyn(predicates)
184 } 184 }
185 185
186 chalk_ir::TyKind::Adt(struct_id, subst) => Ty::Adt(struct_id.0, from_chalk(db, subst)), 186 chalk_ir::TyKind::Adt(adt_id, subst) => Ty::Adt(adt_id, from_chalk(db, subst)),
187 chalk_ir::TyKind::AssociatedType(type_id, subst) => Ty::AssociatedType( 187 chalk_ir::TyKind::AssociatedType(type_id, subst) => Ty::AssociatedType(
188 from_chalk::<TypeAliasAsAssocType, _>(db, type_id).0, 188 from_chalk::<TypeAliasAsAssocType, _>(db, type_id).0,
189 from_chalk(db, subst), 189 from_chalk(db, subst),
@@ -325,18 +325,6 @@ impl ToChalk for hir_def::ImplId {
325 } 325 }
326} 326}
327 327
328impl ToChalk for hir_def::AdtId {
329 type Chalk = AdtId;
330
331 fn to_chalk(self, _db: &dyn HirDatabase) -> Self::Chalk {
332 chalk_ir::AdtId(self.into())
333 }
334
335 fn from_chalk(_db: &dyn HirDatabase, id: AdtId) -> Self {
336 id.0
337 }
338}
339
340impl ToChalk for CallableDefId { 328impl ToChalk for CallableDefId {
341 type Chalk = FnDefId; 329 type Chalk = FnDefId;
342 330