lint remainder, document test w/ half expr

This commit is contained in:
Andre Bogus 2016-04-30 17:11:59 +02:00
parent 9a99979cc4
commit a967440186
2 changed files with 2 additions and 2 deletions

View File

@ -55,7 +55,7 @@ impl LateLintPass for Arithmetic {
match expr.node {
hir::ExprBinary(ref op, ref l, ref r) => {
match op.node {
hir::BiRem | hir::BiAnd | hir::BiOr | hir::BiBitAnd |
hir::BiAnd | hir::BiOr | hir::BiBitAnd |
hir::BiBitOr | hir::BiBitXor | hir::BiShl | hir::BiShr |
hir::BiEq | hir::BiLt | hir::BiLe | hir::BiNe | hir::BiGe |
hir::BiGt => return,

View File

@ -8,7 +8,7 @@ fn main() {
1 + i; //~ERROR integer arithmetic detected
i * 2; //~ERROR integer arithmetic detected
1 % //~ERROR integer arithmetic detected
i / 2;
i / 2; // no error, this is part of the expression in the preceding line
i - 2 + 2 - i; //~ERROR integer arithmetic detected
-i; //~ERROR integer arithmetic detected