Skip to content

Commit 0fc61be

Browse files
committed
Add the other overloadable operations to suspicious_arithmetic_impl
In #2268 I idly mused that the other user-overloadable operations could be added to this lint. Knowing that the lint was arguably incomplete was gnawing at the back of my mind, so I figured that I might as well make this PR, particularly given the change needed was so small.
1 parent 2f4de2f commit 0fc61be

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

clippy_lints/src/suspicious_trait_impl.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,18 @@ impl<'tcx> LateLintPass<'tcx> for SuspiciousImpl {
8686
cx,
8787
expr,
8888
binop.node,
89-
&["Add", "Sub", "Mul", "Div"],
89+
&["Add", "Sub", "Mul", "Div", "Rem", "BitAnd", "BitOr", "BitXor", "Shl", "Shr"],
9090
&[
9191
hir::BinOpKind::Add,
9292
hir::BinOpKind::Sub,
9393
hir::BinOpKind::Mul,
9494
hir::BinOpKind::Div,
95+
hir::BinOpKind::Rem,
96+
hir::BinOpKind::BitAnd,
97+
hir::BinOpKind::BitOr,
98+
hir::BinOpKind::BitXor,
99+
hir::BinOpKind::Shl,
100+
hir::BinOpKind::Shr,
95101
],
96102
) {
97103
span_lint(

0 commit comments

Comments
 (0)