]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/escape.rs
Merge branch 'macro-use' into HEAD
[rust.git] / clippy_lints / src / escape.rs
index c718e1f417c99f28cdf8b2eea8942e74cf125f5b..ff5c85b6009e0279a36d77a638ca7f31eba0bf78 100644 (file)
@@ -2,6 +2,7 @@
 use rustc::hir::intravisit as visit;
 use rustc::hir::map::Node::{NodeExpr, NodeStmt};
 use rustc::lint::*;
+use rustc::{declare_lint, lint_array};
 use rustc::middle::expr_use_visitor::*;
 use rustc::middle::mem_categorization::{cmt_, Categorization};
 use rustc::ty::{self, Ty};
@@ -110,10 +111,10 @@ fn consume_pat(&mut self, consume_pat: &Pat, cmt: &cmt_<'tcx>, _: ConsumeMode) {
         if let Categorization::Rvalue(..) = cmt.cat {
             let id = map.hir_to_node_id(cmt.hir_id);
             if let Some(NodeStmt(st)) = map.find(map.get_parent_node(id)) {
-                if let StmtDecl(ref decl, _) = st.node {
-                    if let DeclLocal(ref loc) = decl.node {
+                if let StmtKind::Decl(ref decl, _) = st.node {
+                    if let DeclKind::Local(ref loc) = decl.node {
                         if let Some(ref ex) = loc.init {
-                            if let ExprBox(..) = ex.node {
+                            if let ExprKind::Box(..) = ex.node {
                                 if is_non_trait_box(cmt.ty) && !self.is_large_box(cmt.ty) {
                                     // let x = box (...)
                                     self.set.insert(consume_pat.id);