diff options
Diffstat (limited to 'crates/hir_ty/src/traits/chalk')
-rw-r--r-- | crates/hir_ty/src/traits/chalk/mapping.rs | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/crates/hir_ty/src/traits/chalk/mapping.rs b/crates/hir_ty/src/traits/chalk/mapping.rs index 23ef07d77..56a30363b 100644 --- a/crates/hir_ty/src/traits/chalk/mapping.rs +++ b/crates/hir_ty/src/traits/chalk/mapping.rs | |||
@@ -72,10 +72,9 @@ impl ToChalk for Ty { | |||
72 | } | 72 | } |
73 | TyKind::Never => chalk_ir::TyKind::Never.intern(&Interner), | 73 | TyKind::Never => chalk_ir::TyKind::Never.intern(&Interner), |
74 | 74 | ||
75 | TyKind::Closure(def, expr, substs) => { | 75 | TyKind::Closure(closure_id, substs) => { |
76 | let closure_id = db.intern_closure((def, expr)); | ||
77 | let substitution = substs.to_chalk(db); | 76 | let substitution = substs.to_chalk(db); |
78 | chalk_ir::TyKind::Closure(closure_id.into(), substitution).intern(&Interner) | 77 | chalk_ir::TyKind::Closure(closure_id, substitution).intern(&Interner) |
79 | } | 78 | } |
80 | 79 | ||
81 | TyKind::Adt(adt_id, substs) => { | 80 | TyKind::Adt(adt_id, substs) => { |
@@ -203,11 +202,7 @@ impl ToChalk for Ty { | |||
203 | TyKind::FnDef(fn_def_id, from_chalk(db, subst)) | 202 | TyKind::FnDef(fn_def_id, from_chalk(db, subst)) |
204 | } | 203 | } |
205 | 204 | ||
206 | chalk_ir::TyKind::Closure(id, subst) => { | 205 | chalk_ir::TyKind::Closure(id, subst) => TyKind::Closure(id, from_chalk(db, subst)), |
207 | let id: crate::db::ClosureId = id.into(); | ||
208 | let (def, expr) = db.lookup_intern_closure(id); | ||
209 | TyKind::Closure(def, expr, from_chalk(db, subst)) | ||
210 | } | ||
211 | 206 | ||
212 | chalk_ir::TyKind::Foreign(foreign_def_id) => TyKind::ForeignType(foreign_def_id), | 207 | chalk_ir::TyKind::Foreign(foreign_def_id) => TyKind::ForeignType(foreign_def_id), |
213 | chalk_ir::TyKind::Generator(_, _) => unimplemented!(), // FIXME | 208 | chalk_ir::TyKind::Generator(_, _) => unimplemented!(), // FIXME |