We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
neg_cmp_op_on_partial_ord
1 parent 7c17dd3 commit ff28de2Copy full SHA for ff28de2
clippy_lints/src/neg_cmp_op_on_partial_ord.rs
@@ -45,10 +45,10 @@ declare_lint_pass!(NoNegCompOpForPartialOrd => [NEG_CMP_OP_ON_PARTIAL_ORD]);
45
46
impl<'tcx> LateLintPass<'tcx> for NoNegCompOpForPartialOrd {
47
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
+ if let ExprKind::Unary(UnOp::Not, inner) = expr.kind
50
&& let ExprKind::Binary(ref op, left, _) = inner.kind
51
&& let BinOpKind::Le | BinOpKind::Ge | BinOpKind::Lt | BinOpKind::Gt = op.node
+ && !in_external_macro(cx.sess(), expr.span)
52
{
53
let ty = cx.typeck_results().expr_ty(left);
54
0 commit comments