From 2d69eb131f58dee1bc188b8df8d5cf0ebf9d97f2 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sat, 13 Mar 2021 19:27:09 +0100 Subject: Use chalk_ir::ClosureId --- crates/hir_ty/src/traits/chalk/mapping.rs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'crates/hir_ty/src/traits/chalk') 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 { } TyKind::Never => chalk_ir::TyKind::Never.intern(&Interner), - TyKind::Closure(def, expr, substs) => { - let closure_id = db.intern_closure((def, expr)); + TyKind::Closure(closure_id, substs) => { let substitution = substs.to_chalk(db); - chalk_ir::TyKind::Closure(closure_id.into(), substitution).intern(&Interner) + chalk_ir::TyKind::Closure(closure_id, substitution).intern(&Interner) } TyKind::Adt(adt_id, substs) => { @@ -203,11 +202,7 @@ impl ToChalk for Ty { TyKind::FnDef(fn_def_id, from_chalk(db, subst)) } - chalk_ir::TyKind::Closure(id, subst) => { - let id: crate::db::ClosureId = id.into(); - let (def, expr) = db.lookup_intern_closure(id); - TyKind::Closure(def, expr, from_chalk(db, subst)) - } + chalk_ir::TyKind::Closure(id, subst) => TyKind::Closure(id, from_chalk(db, subst)), chalk_ir::TyKind::Foreign(foreign_def_id) => TyKind::ForeignType(foreign_def_id), chalk_ir::TyKind::Generator(_, _) => unimplemented!(), // FIXME -- cgit v1.2.3