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};
return;
}
if let Categorization::Rvalue(..) = cmt.cat {
- if let Some(NodeStmt(st)) = map.find(map.get_parent_node(cmt.id)) {
- if let StmtDecl(ref decl, _) = st.node {
- if let DeclLocal(ref loc) = decl.node {
+ let id = map.hir_to_node_id(cmt.hir_id);
+ if let Some(NodeStmt(st)) = map.find(map.get_parent_node(id)) {
+ 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);