mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 13:43:17 +00:00
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.
This commit is contained in:
parent
2f4de2fc75
commit
0fc61becb5
1 changed files with 7 additions and 1 deletions
|
@ -86,12 +86,18 @@ impl<'tcx> LateLintPass<'tcx> for SuspiciousImpl {
|
|||
cx,
|
||||
expr,
|
||||
binop.node,
|
||||
&["Add", "Sub", "Mul", "Div"],
|
||||
&["Add", "Sub", "Mul", "Div", "Rem", "BitAnd", "BitOr", "BitXor", "Shl", "Shr"],
|
||||
&[
|
||||
hir::BinOpKind::Add,
|
||||
hir::BinOpKind::Sub,
|
||||
hir::BinOpKind::Mul,
|
||||
hir::BinOpKind::Div,
|
||||
hir::BinOpKind::Rem,
|
||||
hir::BinOpKind::BitAnd,
|
||||
hir::BinOpKind::BitOr,
|
||||
hir::BinOpKind::BitXor,
|
||||
hir::BinOpKind::Shl,
|
||||
hir::BinOpKind::Shr,
|
||||
],
|
||||
) {
|
||||
span_lint(
|
||||
|
|
Loading…
Reference in a new issue