mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-02 01:52:51 +00:00
Move in_macro check to end of expression since usual case is not inside macro
This commit is contained in:
parent
1f36aa519e
commit
b9abe028c9
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user