about summary refs log tree commit diff
path: root/clippy_lints/src
diff options
context:
space:
mode:
authorhenil <dedaniahenil@gmail.com>2020-10-30 17:11:44 +0530
committerhenil <dedaniahenil@gmail.com>2020-10-30 17:31:10 +0530
commitfa0a78b130d52d4504eefbd16689b140e05fce59 (patch)
tree241bd1625c2ee02e06413a19821f9f8084dac6fa /clippy_lints/src
parente97602e4825fd5a01834d7b0e218703dcc82c091 (diff)
removed lint for division/modulo for literal `0`
Diffstat (limited to 'clippy_lints/src')
-rw-r--r--clippy_lints/src/arithmetic.rs7
1 files changed, 1 insertions, 6 deletions
diff --git a/clippy_lints/src/arithmetic.rs b/clippy_lints/src/arithmetic.rs
index b1cdbab6de9..9861d8cfc4e 100644
--- a/clippy_lints/src/arithmetic.rs
+++ b/clippy_lints/src/arithmetic.rs
@@ -90,12 +90,7 @@ impl<'tcx> LateLintPass<'tcx> for Arithmetic {
                 if l_ty.peel_refs().is_integral() && r_ty.peel_refs().is_integral() {
                     match op.node {
                         hir::BinOpKind::Div | hir::BinOpKind::Rem => match &r.kind {
-                            hir::ExprKind::Lit(lit) => {
-                                if let rustc_ast::ast::LitKind::Int(0, _) = lit.node {
-                                    span_lint(cx, INTEGER_ARITHMETIC, expr.span, "integer arithmetic detected");
-                                    self.expr_span = Some(expr.span);
-                                }
-                            },
+                            hir::ExprKind::Lit(_lit) => (),
                             hir::ExprKind::Unary(hir::UnOp::UnNeg, expr) => {
                                 if let hir::ExprKind::Lit(lit) = &expr.kind {
                                     if let rustc_ast::ast::LitKind::Int(1, _) = lit.node {