about summary refs log tree commit diff
path: root/clippy_lints/src/mutable_debug_assertion.rs
diff options
context:
space:
mode:
authorflip1995 <hello@philkrones.com>2020-01-29 15:46:38 +0100
committerflip1995 <hello@philkrones.com>2020-01-31 10:39:05 +0100
commit9fbd7f478e59cca00011b6ac0ed89bada8823e2a (patch)
tree4a900f6d5f293e678d1ab4c84a9cc4bcda8dbd62 /clippy_lints/src/mutable_debug_assertion.rs
parentb31a3dff480ffad248fa5b2c66fbe9b9d6726314 (diff)
downloadrust-9fbd7f478e59cca00011b6ac0ed89bada8823e2a.tar.gz
rust-9fbd7f478e59cca00011b6ac0ed89bada8823e2a.zip
Don't trigger `debug_assert_with_mut_call` on `.await`
Diffstat (limited to 'clippy_lints/src/mutable_debug_assertion.rs')
-rw-r--r--clippy_lints/src/mutable_debug_assertion.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/clippy_lints/src/mutable_debug_assertion.rs b/clippy_lints/src/mutable_debug_assertion.rs
index 94ef61dcf59..881f59bbabd 100644
--- a/clippy_lints/src/mutable_debug_assertion.rs
+++ b/clippy_lints/src/mutable_debug_assertion.rs
@@ -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;
@@ -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,
         }