aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/ty.rs
diff options
context:
space:
mode:
authorWizardOfMenlo <[email protected]>2019-01-28 14:52:43 +0000
committerWizardOfMenlo <[email protected]>2019-01-28 14:52:43 +0000
commit9416904d148129a6e0315fd139ae5ae516ff104c (patch)
treeb6a2754810348a9675cd86e4343e4a6bd725111e /crates/ra_hir/src/ty.rs
parentebb19bb95c79671d5ef1e21a8fcb4daafc356490 (diff)
Added support for primitive types type inference when using std::ops::Not
Diffstat (limited to 'crates/ra_hir/src/ty.rs')
-rw-r--r--crates/ra_hir/src/ty.rs14
1 files changed, 11 insertions, 3 deletions
diff --git a/crates/ra_hir/src/ty.rs b/crates/ra_hir/src/ty.rs
index 37715a903..81cff8c47 100644
--- a/crates/ra_hir/src/ty.rs
+++ b/crates/ra_hir/src/ty.rs
@@ -1588,9 +1588,17 @@ impl<'a, D: HirDatabase> InferenceContext<'a, D> {
1588 _ => Ty::Unknown, 1588 _ => Ty::Unknown,
1589 } 1589 }
1590 } 1590 }
1591 UnaryOp::Not if inner_ty == Ty::Bool => Ty::Bool, 1591 UnaryOp::Not => {
1592 // TODO: resolve ops::Not trait for inner_ty 1592 match inner_ty {
1593 UnaryOp::Not => Ty::Unknown, 1593 Ty::Bool
1594 | Ty::Int(primitive::UncertainIntTy::Unknown)
1595 | Ty::Int(primitive::UncertainIntTy::Signed(..))
1596 | Ty::Int(primitive::UncertainIntTy::Unsigned(..))
1597 | Ty::Infer(InferTy::IntVar(..)) => inner_ty,
1598 // TODO: resolve ops::Not trait for inner_ty
1599 _ => Ty::Unknown,
1600 }
1601 }
1594 } 1602 }
1595 } 1603 }
1596 Expr::BinaryOp { lhs, rhs, op } => match op { 1604 Expr::BinaryOp { lhs, rhs, op } => match op {