diff options
author | Florian Diebold <[email protected]> | 2019-12-20 17:27:51 +0000 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2019-12-20 17:28:21 +0000 |
commit | 9c3f00a90651998c2cd4151f43f17cd92ef8eef1 (patch) | |
tree | 2b96a667cd1d7bee5ec41abe38d777bc181b674d /crates/ra_hir_ty/src/infer | |
parent | 99d6f544f2a590d3feef47ce62d5cd9a8b463a47 (diff) |
Fix coercion of last expression in function body
Diffstat (limited to 'crates/ra_hir_ty/src/infer')
-rw-r--r-- | crates/ra_hir_ty/src/infer/expr.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/ra_hir_ty/src/infer/expr.rs b/crates/ra_hir_ty/src/infer/expr.rs index 253332c30..3af05394c 100644 --- a/crates/ra_hir_ty/src/infer/expr.rs +++ b/crates/ra_hir_ty/src/infer/expr.rs | |||
@@ -41,7 +41,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
41 | 41 | ||
42 | /// Infer type of expression with possibly implicit coerce to the expected type. | 42 | /// Infer type of expression with possibly implicit coerce to the expected type. |
43 | /// Return the type after possible coercion. | 43 | /// Return the type after possible coercion. |
44 | fn infer_expr_coerce(&mut self, expr: ExprId, expected: &Expectation) -> Ty { | 44 | pub(super) fn infer_expr_coerce(&mut self, expr: ExprId, expected: &Expectation) -> Ty { |
45 | let ty = self.infer_expr_inner(expr, &expected); | 45 | let ty = self.infer_expr_inner(expr, &expected); |
46 | let ty = if !self.coerce(&ty, &expected.ty) { | 46 | let ty = if !self.coerce(&ty, &expected.ty) { |
47 | self.result | 47 | self.result |