diff options
Diffstat (limited to 'crates/ra_hir/src/ty/infer/expr.rs')
-rw-r--r-- | crates/ra_hir/src/ty/infer/expr.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/crates/ra_hir/src/ty/infer/expr.rs b/crates/ra_hir/src/ty/infer/expr.rs index 6d9792391..c6802487a 100644 --- a/crates/ra_hir/src/ty/infer/expr.rs +++ b/crates/ra_hir/src/ty/infer/expr.rs | |||
@@ -130,10 +130,8 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
130 | TypeCtor::FnPtr { num_args: sig_tys.len() as u16 - 1 }, | 130 | TypeCtor::FnPtr { num_args: sig_tys.len() as u16 - 1 }, |
131 | Substs(sig_tys.into()), | 131 | Substs(sig_tys.into()), |
132 | ); | 132 | ); |
133 | let closure_ty = Ty::apply_one( | 133 | let closure_ty = |
134 | TypeCtor::Closure { def: self.body.owner(), expr: tgt_expr }, | 134 | Ty::apply_one(TypeCtor::Closure { def: self.owner, expr: tgt_expr }, sig_ty); |
135 | sig_ty, | ||
136 | ); | ||
137 | 135 | ||
138 | // Eagerly try to relate the closure type with the expected | 136 | // Eagerly try to relate the closure type with the expected |
139 | // type, otherwise we often won't have enough information to | 137 | // type, otherwise we often won't have enough information to |
@@ -184,7 +182,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
184 | } | 182 | } |
185 | Expr::Path(p) => { | 183 | Expr::Path(p) => { |
186 | // FIXME this could be more efficient... | 184 | // FIXME this could be more efficient... |
187 | let resolver = expr::resolver_for_expr(self.body.clone(), self.db, tgt_expr); | 185 | let resolver = expr::resolver_for_expr(self.db, self.owner, tgt_expr); |
188 | self.infer_path(&resolver, p, tgt_expr.into()).unwrap_or(Ty::Unknown) | 186 | self.infer_path(&resolver, p, tgt_expr.into()).unwrap_or(Ty::Unknown) |
189 | } | 187 | } |
190 | Expr::Continue => Ty::simple(TypeCtor::Never), | 188 | Expr::Continue => Ty::simple(TypeCtor::Never), |