]> git.lizzy.rs Git - rust.git/commitdiff
lint remainder, document test w/ half expr
authorAndre Bogus <bogusandre@gmail.com>
Sat, 30 Apr 2016 15:11:59 +0000 (17:11 +0200)
committerAndre Bogus <bogusandre@gmail.com>
Sat, 30 Apr 2016 15:11:59 +0000 (17:11 +0200)
src/arithmetic.rs
tests/compile-fail/arithmetic.rs

index 72375f4a15ebe012d9b2825f8cde7f2f16e82ea6..6f34fdc242763b79fd7bb672994543da7c362d78 100644 (file)
@@ -55,7 +55,7 @@ fn check_expr(&mut self, cx: &LateContext, expr: &hir::Expr) {
         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,
index 856f390943ba91d34b11786360fe0e09acd7976e..3b9e1b8b85ad40a0dd05aa4c01c5b3b28989b7ec 100644 (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