about summary refs log tree commit diff
path: root/clippy_lints/src/mutable_debug_assertion.rs
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2019-11-27 14:30:10 -0800
committerManish Goregaokar <manishsmail@gmail.com>2019-11-27 14:39:28 -0800
commit341e266508ee9355f91938e3ff8b8186f7e076f2 (patch)
tree7264c3ffcaaa7cf0bd7933af610794fee1cad7d5 /clippy_lints/src/mutable_debug_assertion.rs
parent6eeac46b916900d83d340bfbdd77ff759f2d3ebe (diff)
downloadrust-341e266508ee9355f91938e3ff8b8186f7e076f2.tar.gz
rust-341e266508ee9355f91938e3ff8b8186f7e076f2.zip
Add BorrowKind::Ref
Diffstat (limited to 'clippy_lints/src/mutable_debug_assertion.rs')
-rw-r--r--clippy_lints/src/mutable_debug_assertion.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/clippy_lints/src/mutable_debug_assertion.rs b/clippy_lints/src/mutable_debug_assertion.rs
index fde5ac621a9..67cb696b402 100644
--- a/clippy_lints/src/mutable_debug_assertion.rs
+++ b/clippy_lints/src/mutable_debug_assertion.rs
@@ -2,7 +2,7 @@ use crate::utils::{is_direct_expn_of, span_lint};
 use if_chain::if_chain;
 use matches::matches;
 use rustc::hir::intravisit::{walk_expr, NestedVisitorMap, Visitor};
-use rustc::hir::{Expr, ExprKind, Mutability, StmtKind, UnOp};
+use rustc::hir::{BorrowKind, Expr, ExprKind, Mutability, StmtKind, UnOp};
 use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
 use rustc::{declare_lint_pass, declare_tool_lint, ty};
 use syntax_pos::Span;
@@ -77,14 +77,14 @@ fn extract_call<'a, 'tcx>(cx: &'a LateContext<'a, 'tcx>, e: &'tcx Expr) -> Optio
                         if let ExprKind::Tup(ref conditions) = headerexpr.kind;
                         if conditions.len() == 2;
                         then {
-                            if let ExprKind::AddrOf(_, _, ref lhs) = conditions[0].kind {
+                            if let ExprKind::AddrOf(BorrowKind::Ref, _, ref lhs) = conditions[0].kind {
                                 let mut visitor = MutArgVisitor::new(cx);
                                 visitor.visit_expr(lhs);
                                 if let Some(span) = visitor.expr_span() {
                                     return Some(span);
                                 }
                             }
-                            if let ExprKind::AddrOf(_, _, ref rhs) = conditions[1].kind {
+                            if let ExprKind::AddrOf(BorrowKind::Ref, _, ref rhs) = conditions[1].kind {
                                 let mut visitor = MutArgVisitor::new(cx);
                                 visitor.visit_expr(rhs);
                                 if let Some(span) = visitor.expr_span() {
@@ -128,7 +128,7 @@ impl<'a, 'tcx> MutArgVisitor<'a, 'tcx> {
 impl<'a, 'tcx> Visitor<'tcx> for MutArgVisitor<'a, 'tcx> {
     fn visit_expr(&mut self, expr: &'tcx Expr) {
         match expr.kind {
-            ExprKind::AddrOf(_, Mutability::Mutable, _) => {
+            ExprKind::AddrOf(BorrowKind::Ref, Mutability::Mutable, _) => {
                 self.found = true;
                 return;
             },