lint remainder, document test w/ half expr
This commit is contained in:
parent
9a99979cc4
commit
a967440186
@ -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,
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user