Skip to content

Commit

Permalink
Don't trigger debug_assert_with_mut_call on .await
Browse files Browse the repository at this point in the history
  • Loading branch information
flip1995 committed Jan 30, 2020
1 parent 07ad733 commit 4ad87ec
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion clippy_lints/src/mutable_debug_assertion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use matches::matches;
use rustc::hir::map::Map;
use rustc::ty;
use rustc_hir::intravisit::{walk_expr, NestedVisitorMap, Visitor};
use rustc_hir::{BorrowKind, Expr, ExprKind, Mutability, StmtKind, UnOp};
use rustc_hir::{BorrowKind, Expr, ExprKind, MatchSource, Mutability, StmtKind, UnOp};
use rustc_lint::{LateContext, LateLintPass};
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::Span;
Expand Down Expand Up @@ -147,6 +147,8 @@ impl<'a, 'tcx> Visitor<'tcx> for MutArgVisitor<'a, 'tcx> {
}
}
},
// Don't check await desugars
ExprKind::Match(_, _, MatchSource::AwaitDesugar) => return,
_ if !self.found => self.expr_span = Some(expr.span),
_ => return,
}
Expand Down

0 comments on commit 4ad87ec

Please sign in to comment.