Use chalk_ir::ClosureId

This commit is contained in:
Florian Diebold 2021-03-13 19:27:09 +01:00
parent be7a31fbd6
commit 2d69eb131f
5 changed files with 17 additions and 23 deletions

View file

@ -264,8 +264,9 @@ impl<'a> InferenceContext<'a> {
substs: Substs(sig_tys.clone().into()),
})
.intern(&Interner);
let closure_id = self.db.intern_closure((self.owner, tgt_expr)).into();
let closure_ty =
TyKind::Closure(self.owner, tgt_expr, Substs::single(sig_ty)).intern(&Interner);
TyKind::Closure(closure_id, Substs::single(sig_ty)).intern(&Interner);
// Eagerly try to relate the closure type with the expected
// type, otherwise we often won't have enough information to