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, 5 insertions, 3 deletions
diff --git a/crates/ra_hir/src/ty/infer/expr.rs b/crates/ra_hir/src/ty/infer/expr.rs index 5e68a1678..ac570075f 100644 --- a/crates/ra_hir/src/ty/infer/expr.rs +++ b/crates/ra_hir/src/ty/infer/expr.rs | |||
@@ -6,13 +6,13 @@ use std::sync::Arc; | |||
6 | use hir_def::{ | 6 | use hir_def::{ |
7 | builtin_type::Signedness, | 7 | builtin_type::Signedness, |
8 | path::{GenericArg, GenericArgs}, | 8 | path::{GenericArg, GenericArgs}, |
9 | resolver::resolver_for_expr, | ||
9 | }; | 10 | }; |
10 | use hir_expand::name; | 11 | use hir_expand::name; |
11 | 12 | ||
12 | use super::{BindingMode, Expectation, InferenceContext, InferenceDiagnostic, TypeMismatch}; | ||
13 | use crate::{ | 13 | use crate::{ |
14 | db::HirDatabase, | 14 | db::HirDatabase, |
15 | expr::{self, Array, BinaryOp, Expr, ExprId, Literal, Statement, UnaryOp}, | 15 | expr::{Array, BinaryOp, Expr, ExprId, Literal, Statement, UnaryOp}, |
16 | generics::{GenericParams, HasGenericParams}, | 16 | generics::{GenericParams, HasGenericParams}, |
17 | ty::{ | 17 | ty::{ |
18 | autoderef, method_resolution, op, CallableDef, InferTy, IntTy, Mutability, Namespace, | 18 | autoderef, method_resolution, op, CallableDef, InferTy, IntTy, Mutability, Namespace, |
@@ -22,6 +22,8 @@ use crate::{ | |||
22 | Adt, Name, | 22 | Adt, Name, |
23 | }; | 23 | }; |
24 | 24 | ||
25 | use super::{BindingMode, Expectation, InferenceContext, InferenceDiagnostic, TypeMismatch}; | ||
26 | |||
25 | impl<'a, D: HirDatabase> InferenceContext<'a, D> { | 27 | impl<'a, D: HirDatabase> InferenceContext<'a, D> { |
26 | pub(super) fn infer_expr(&mut self, tgt_expr: ExprId, expected: &Expectation) -> Ty { | 28 | pub(super) fn infer_expr(&mut self, tgt_expr: ExprId, expected: &Expectation) -> Ty { |
27 | let ty = self.infer_expr_inner(tgt_expr, expected); | 29 | let ty = self.infer_expr_inner(tgt_expr, expected); |
@@ -186,7 +188,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
186 | } | 188 | } |
187 | Expr::Path(p) => { | 189 | Expr::Path(p) => { |
188 | // FIXME this could be more efficient... | 190 | // FIXME this could be more efficient... |
189 | let resolver = expr::resolver_for_expr(self.db, self.owner, tgt_expr); | 191 | let resolver = resolver_for_expr(self.db, self.owner.into(), tgt_expr); |
190 | self.infer_path(&resolver, p, tgt_expr.into()).unwrap_or(Ty::Unknown) | 192 | self.infer_path(&resolver, p, tgt_expr.into()).unwrap_or(Ty::Unknown) |
191 | } | 193 | } |
192 | Expr::Continue => Ty::simple(TypeCtor::Never), | 194 | Expr::Continue => Ty::simple(TypeCtor::Never), |