Skip to content

Commit ff28de2

Browse files
committed
neg_cmp_op_on_partial_ord: Delay macro check
1 parent 7c17dd3 commit ff28de2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clippy_lints/src/neg_cmp_op_on_partial_ord.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ declare_lint_pass!(NoNegCompOpForPartialOrd => [NEG_CMP_OP_ON_PARTIAL_ORD]);
4545

4646
impl<'tcx> LateLintPass<'tcx> for NoNegCompOpForPartialOrd {
4747
fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
48-
if !in_external_macro(cx.sess(), expr.span)
49-
&& let ExprKind::Unary(UnOp::Not, inner) = expr.kind
48+
if let ExprKind::Unary(UnOp::Not, inner) = expr.kind
5049
&& let ExprKind::Binary(ref op, left, _) = inner.kind
5150
&& let BinOpKind::Le | BinOpKind::Ge | BinOpKind::Lt | BinOpKind::Gt = op.node
51+
&& !in_external_macro(cx.sess(), expr.span)
5252
{
5353
let ty = cx.typeck_results().expr_ty(left);
5454

0 commit comments

Comments
 (0)