Skip to content

Commit a967440

Browse files
committed
lint remainder, document test w/ half expr
1 parent 9a99979 commit a967440

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/arithmetic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ impl LateLintPass for Arithmetic {
5555
match expr.node {
5656
hir::ExprBinary(ref op, ref l, ref r) => {
5757
match op.node {
58-
hir::BiRem | hir::BiAnd | hir::BiOr | hir::BiBitAnd |
58+
hir::BiAnd | hir::BiOr | hir::BiBitAnd |
5959
hir::BiBitOr | hir::BiBitXor | hir::BiShl | hir::BiShr |
6060
hir::BiEq | hir::BiLt | hir::BiLe | hir::BiNe | hir::BiGe |
6161
hir::BiGt => return,

tests/compile-fail/arithmetic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ fn main() {
88
1 + i; //~ERROR integer arithmetic detected
99
i * 2; //~ERROR integer arithmetic detected
1010
1 % //~ERROR integer arithmetic detected
11-
i / 2;
11+
i / 2; // no error, this is part of the expression in the preceding line
1212
i - 2 + 2 - i; //~ERROR integer arithmetic detected
1313
-i; //~ERROR integer arithmetic detected
1414

0 commit comments

Comments
 (0)