aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty/src/infer
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-01-17 16:03:09 +0000
committerGitHub <[email protected]>2020-01-17 16:03:09 +0000
commitd1d91dfe4d52856403a17e2644a22c919690010d (patch)
tree52d96e64a1235e3b22d5ed8e213a7b616d115aba /crates/ra_hir_ty/src/infer
parent07dca1123dfaec527c6ba3164125309f5c4cc3db (diff)
parent33d637f2ddb5e5eab6d5dfaf75042dfc1a58d241 (diff)
Merge #2870
2870: Fix inference for shift operators r=matklad a=flodiebold Fixes #2602. Co-authored-by: Florian Diebold <[email protected]>
Diffstat (limited to 'crates/ra_hir_ty/src/infer')
-rw-r--r--crates/ra_hir_ty/src/infer/expr.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_hir_ty/src/infer/expr.rs b/crates/ra_hir_ty/src/infer/expr.rs
index d6a17e469..31259a01d 100644
--- a/crates/ra_hir_ty/src/infer/expr.rs
+++ b/crates/ra_hir_ty/src/infer/expr.rs
@@ -386,11 +386,11 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> {
386 let lhs_ty = self.infer_expr(*lhs, &lhs_expectation); 386 let lhs_ty = self.infer_expr(*lhs, &lhs_expectation);
387 // FIXME: find implementation of trait corresponding to operation 387 // FIXME: find implementation of trait corresponding to operation
388 // symbol and resolve associated `Output` type 388 // symbol and resolve associated `Output` type
389 let rhs_expectation = op::binary_op_rhs_expectation(*op, lhs_ty); 389 let rhs_expectation = op::binary_op_rhs_expectation(*op, lhs_ty.clone());
390 let rhs_ty = self.infer_expr(*rhs, &Expectation::has_type(rhs_expectation)); 390 let rhs_ty = self.infer_expr(*rhs, &Expectation::has_type(rhs_expectation));
391 391
392 // FIXME: similar as above, return ty is often associated trait type 392 // FIXME: similar as above, return ty is often associated trait type
393 op::binary_op_return_ty(*op, rhs_ty) 393 op::binary_op_return_ty(*op, lhs_ty, rhs_ty)
394 } 394 }
395 _ => Ty::Unknown, 395 _ => Ty::Unknown,
396 }, 396 },