diff options
Diffstat (limited to 'crates/ra_hir/src/ty')
-rw-r--r-- | crates/ra_hir/src/ty/infer/expr.rs | 6 | ||||
-rw-r--r-- | crates/ra_hir/src/ty/traits.rs | 5 |
2 files changed, 7 insertions, 4 deletions
diff --git a/crates/ra_hir/src/ty/infer/expr.rs b/crates/ra_hir/src/ty/infer/expr.rs index 994a6d7e9..b581d192f 100644 --- a/crates/ra_hir/src/ty/infer/expr.rs +++ b/crates/ra_hir/src/ty/infer/expr.rs | |||
@@ -137,8 +137,10 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
137 | TypeCtor::FnPtr { num_args: sig_tys.len() as u16 - 1 }, | 137 | TypeCtor::FnPtr { num_args: sig_tys.len() as u16 - 1 }, |
138 | Substs(sig_tys.into()), | 138 | Substs(sig_tys.into()), |
139 | ); | 139 | ); |
140 | let closure_ty = | 140 | let closure_ty = Ty::apply_one( |
141 | Ty::apply_one(TypeCtor::Closure { def: self.owner, expr: tgt_expr }, sig_ty); | 141 | TypeCtor::Closure { def: self.owner.into(), expr: tgt_expr }, |
142 | sig_ty, | ||
143 | ); | ||
142 | 144 | ||
143 | // Eagerly try to relate the closure type with the expected | 145 | // Eagerly try to relate the closure type with the expected |
144 | // type, otherwise we often won't have enough information to | 146 | // type, otherwise we often won't have enough information to |
diff --git a/crates/ra_hir/src/ty/traits.rs b/crates/ra_hir/src/ty/traits.rs index 268fa09e4..b9a5d651f 100644 --- a/crates/ra_hir/src/ty/traits.rs +++ b/crates/ra_hir/src/ty/traits.rs | |||
@@ -2,13 +2,14 @@ | |||
2 | use std::sync::{Arc, Mutex}; | 2 | use std::sync::{Arc, Mutex}; |
3 | 3 | ||
4 | use chalk_ir::{cast::Cast, family::ChalkIr}; | 4 | use chalk_ir::{cast::Cast, family::ChalkIr}; |
5 | use hir_def::DefWithBodyId; | ||
5 | use log::debug; | 6 | use log::debug; |
6 | use ra_db::{impl_intern_key, salsa}; | 7 | use ra_db::{impl_intern_key, salsa}; |
7 | use ra_prof::profile; | 8 | use ra_prof::profile; |
8 | use rustc_hash::FxHashSet; | 9 | use rustc_hash::FxHashSet; |
9 | 10 | ||
10 | use super::{Canonical, GenericPredicate, HirDisplay, ProjectionTy, TraitRef, Ty, TypeWalk}; | 11 | use super::{Canonical, GenericPredicate, HirDisplay, ProjectionTy, TraitRef, Ty, TypeWalk}; |
11 | use crate::{db::HirDatabase, expr::ExprId, Crate, DefWithBody, ImplBlock, Trait, TypeAlias}; | 12 | use crate::{db::HirDatabase, expr::ExprId, Crate, ImplBlock, Trait, TypeAlias}; |
12 | 13 | ||
13 | use self::chalk::{from_chalk, ToChalk}; | 14 | use self::chalk::{from_chalk, ToChalk}; |
14 | 15 | ||
@@ -290,7 +291,7 @@ impl FnTrait { | |||
290 | 291 | ||
291 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 292 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
292 | pub struct ClosureFnTraitImplData { | 293 | pub struct ClosureFnTraitImplData { |
293 | def: DefWithBody, | 294 | def: DefWithBodyId, |
294 | expr: ExprId, | 295 | expr: ExprId, |
295 | fn_trait: FnTrait, | 296 | fn_trait: FnTrait, |
296 | } | 297 | } |