diff options
author | Aleksey Kladov <[email protected]> | 2019-08-17 15:42:41 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-08-17 15:42:41 +0100 |
commit | 7e5a186c1fe585aac95019addc963bf74cb112ae (patch) | |
tree | 3ece58abec006c824f38e8470f67229bc7c6acdd /crates/ra_hir/src/ty/infer.rs | |
parent | 8919aa8065c31d55050a6bfe10b574fc71bcec09 (diff) |
Introduce separate hir::BinaryOp
Unlike ast::BinOp, it has significantly more structure to it, so it's
easier to, say, handle all assignment-like operations in the same way.
Diffstat (limited to 'crates/ra_hir/src/ty/infer.rs')
-rw-r--r-- | crates/ra_hir/src/ty/infer.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/crates/ra_hir/src/ty/infer.rs b/crates/ra_hir/src/ty/infer.rs index 675df4a22..33bfd0952 100644 --- a/crates/ra_hir/src/ty/infer.rs +++ b/crates/ra_hir/src/ty/infer.rs | |||
@@ -1265,9 +1265,7 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> { | |||
1265 | Expr::BinaryOp { lhs, rhs, op } => match op { | 1265 | Expr::BinaryOp { lhs, rhs, op } => match op { |
1266 | Some(op) => { | 1266 | Some(op) => { |
1267 | let lhs_expectation = match op { | 1267 | let lhs_expectation = match op { |
1268 | BinaryOp::BooleanAnd | BinaryOp::BooleanOr => { | 1268 | BinaryOp::LogicOp(..) => Expectation::has_type(Ty::simple(TypeCtor::Bool)), |
1269 | Expectation::has_type(Ty::simple(TypeCtor::Bool)) | ||
1270 | } | ||
1271 | _ => Expectation::none(), | 1269 | _ => Expectation::none(), |
1272 | }; | 1270 | }; |
1273 | let lhs_ty = self.infer_expr(*lhs, &lhs_expectation); | 1271 | let lhs_ty = self.infer_expr(*lhs, &lhs_expectation); |