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/infer/expr.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'crates/hir_ty/src/infer/expr.rs') diff --git a/crates/hir_ty/src/infer/expr.rs b/crates/hir_ty/src/infer/expr.rs index 153f22f25..2e21d796c 100644 --- a/crates/hir_ty/src/infer/expr.rs +++ b/crates/hir_ty/src/infer/expr.rs @@ -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 -- cgit v1.2.3 From b035c314b4b0ecd2477fde216dbe7e8801f94d0d Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sat, 13 Mar 2021 20:05:47 +0100 Subject: Use chalk_ir::OpaqueTyId --- crates/hir_ty/src/infer/expr.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'crates/hir_ty/src/infer/expr.rs') diff --git a/crates/hir_ty/src/infer/expr.rs b/crates/hir_ty/src/infer/expr.rs index 2e21d796c..eee3e6ec5 100644 --- a/crates/hir_ty/src/infer/expr.rs +++ b/crates/hir_ty/src/infer/expr.rs @@ -21,8 +21,8 @@ use crate::{ to_assoc_type_id, traits::{chalk::from_chalk, FnTrait, InEnvironment}, utils::{generics, variant_data, Generics}, - AdtId, Binders, CallableDefId, FnPointer, FnSig, Interner, Obligation, OpaqueTyId, Rawness, - Scalar, Substs, TraitRef, Ty, TyKind, + AdtId, Binders, CallableDefId, FnPointer, FnSig, Interner, Obligation, Rawness, Scalar, Substs, + TraitRef, Ty, TyKind, }; use super::{ @@ -179,7 +179,8 @@ impl<'a> InferenceContext<'a> { // Use the first type parameter as the output type of future. // existenail type AsyncBlockImplTrait: Future let inner_ty = self.infer_expr(*body, &Expectation::none()); - let opaque_ty_id = OpaqueTyId::AsyncBlockTypeImplTrait(self.owner, *body); + let impl_trait_id = crate::ImplTraitId::AsyncBlockTypeImplTrait(self.owner, *body); + let opaque_ty_id = self.db.intern_impl_trait_id(impl_trait_id).into(); TyKind::OpaqueType(opaque_ty_id, Substs::single(inner_ty)).intern(&Interner) } Expr::Loop { body, label } => { -- cgit v1.2.3