Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit f16e383

Browse files
committed
Don't trigger debug_assert_with_mut_call on .await
1 parent 2c4df24 commit f16e383

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

clippy_lints/src/mutable_debug_assertion.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use matches::matches;
44
use rustc::hir::map::Map;
55
use rustc::ty;
66
use rustc_hir::intravisit::{walk_expr, NestedVisitorMap, Visitor};
7-
use rustc_hir::{BorrowKind, Expr, ExprKind, Mutability, StmtKind, UnOp};
7+
use rustc_hir::{BorrowKind, Expr, ExprKind, MatchSource, Mutability, StmtKind, UnOp};
88
use rustc_lint::{LateContext, LateLintPass};
99
use rustc_session::{declare_lint_pass, declare_tool_lint};
1010
use rustc_span::Span;
@@ -147,6 +147,8 @@ impl<'a, 'tcx> Visitor<'tcx> for MutArgVisitor<'a, 'tcx> {
147147
}
148148
}
149149
},
150+
// Don't check await desugars
151+
ExprKind::Match(_, _, MatchSource::AwaitDesugar) => return,
150152
_ if !self.found => self.expr_span = Some(expr.span),
151153
_ => return,
152154
}

0 commit comments

Comments
 (0)