]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/middle/expr_use_visitor.rs
scrap `find_node_for_hir_id` in favor of `hir_to_node_id`
[rust.git] / src / librustc / middle / expr_use_visitor.rs
index 66c6cf73513ec921d4cfe36e604b1740b8ca454c..ddbc03292f6442501a65c89d3d947d16472dcab3 100644 (file)
@@ -609,8 +609,7 @@ fn walk_local(&mut self, local: &hir::Local) {
         match local.init {
             None => {
                 local.pat.each_binding(|_, hir_id, span, _| {
-                    // FIXME: converting HirId → NodeId is said to be relatively expensive
-                    let node_id = self.mc.tcx.hir.definitions().find_node_for_hir_id(hir_id);
+                    let node_id = self.mc.tcx.hir.hir_to_node_id(hir_id);
                     self.delegate.decl_without_init(node_id, span);
                 })
             }