Skip to content

Commit 41f23f5

Browse files
authored
Merge pull request #2819 from zayenz/no-op-ref-in-macro
avoid op-ref in macros
2 parents 4e9a08b + f97c38d commit 41f23f5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

clippy_lints/src/eq_op.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@ impl LintPass for EqOp {
5353
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for EqOp {
5454
fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) {
5555
if let ExprBinary(ref op, ref left, ref right) = e.node {
56-
if is_valid_operator(op) && SpanlessEq::new(cx).ignore_fn().eq_expr(left, right) && !in_macro(e.span) {
56+
if in_macro(e.span) {
57+
return;
58+
}
59+
if is_valid_operator(op) && SpanlessEq::new(cx).ignore_fn().eq_expr(left, right) {
5760
span_lint(
5861
cx,
5962
EQ_OP,

0 commit comments

Comments
 (0)