From b9abe028c9d1df5df5871f431319bd60c34e7253 Mon Sep 17 00:00:00 2001 From: Darren Tsung Date: Fri, 22 Dec 2017 10:54:52 -0800 Subject: [PATCH] Move in_macro check to end of expression since usual case is not inside macro --- clippy_lints/src/eq_op.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clippy_lints/src/eq_op.rs b/clippy_lints/src/eq_op.rs index 9bea91848dc3..d62b937f52ff 100644 --- a/clippy_lints/src/eq_op.rs +++ b/clippy_lints/src/eq_op.rs @@ -53,7 +53,7 @@ impl LintPass for EqOp { impl<'a, 'tcx> LateLintPass<'a, 'tcx> for EqOp { fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) { if let ExprBinary(ref op, ref left, ref right) = e.node { - if !in_macro(e.span) && is_valid_operator(op) && SpanlessEq::new(cx).ignore_fn().eq_expr(left, right) { + if is_valid_operator(op) && SpanlessEq::new(cx).ignore_fn().eq_expr(left, right) && !in_macro(e.span) { span_lint( cx, EQ_OP,