]> git.lizzy.rs Git - rust.git/commitdiff
Use `HirId` instead of `NodeId` for lookup
authorPhilipp Hansch <dev@phansch.net>
Tue, 12 Mar 2019 07:11:57 +0000 (08:11 +0100)
committerPhilipp Hansch <dev@phansch.net>
Tue, 12 Mar 2019 07:21:22 +0000 (08:21 +0100)
clippy_lints/src/escape.rs

index 2c6bfae6efe1feb91efcbaf54b84c12e84a24c7b..75b822b69880e136582d5310607130e235fe68d4 100644 (file)
@@ -122,8 +122,7 @@ fn consume_pat(&mut self, consume_pat: &Pat, cmt: &cmt_<'tcx>, _: ConsumeMode) {
             return;
         }
         if let Categorization::Rvalue(..) = cmt.cat {
-            let id = map.hir_to_node_id(cmt.hir_id);
-            if let Some(Node::Stmt(st)) = map.find(map.get_parent_node(id)) {
+            if let Some(Node::Stmt(st)) = map.find_by_hir_id(map.get_parent_node_by_hir_id(cmt.hir_id)) {
                 if let StmtKind::Local(ref loc) = st.node {
                     if let Some(ref ex) = loc.init {
                         if let ExprKind::Box(..) = ex.node {