about summary refs log tree commit diff
diff options
context:
space:
mode:
authorljedrz <ljedrz@gmail.com>2019-06-19 15:35:56 +0200
committerljedrz <ljedrz@gmail.com>2019-06-20 12:47:25 +0200
commit468647cabb231d7a3efbdc7a1819d7dbdf699b36 (patch)
treee4ff10580360d8a46d550f30a2d5585eb747fae5
parentf6eb39203bcd8add887f72c1633cb46c50a13bf4 (diff)
downloadrust-468647cabb231d7a3efbdc7a1819d7dbdf699b36.tar.gz
rust-468647cabb231d7a3efbdc7a1819d7dbdf699b36.zip
remove hir::map::name
-rw-r--r--src/librustc/hir/map/mod.rs7
-rw-r--r--src/librustc_mir/borrow_check/mod.rs3
2 files changed, 1 insertions, 9 deletions
diff --git a/src/librustc/hir/map/mod.rs b/src/librustc/hir/map/mod.rs
index 87da3273bd2..10632bc4d8a 100644
--- a/src/librustc/hir/map/mod.rs
+++ b/src/librustc/hir/map/mod.rs
@@ -940,13 +940,6 @@ impl<'hir> Map<'hir> {
         }
     }
 
-    /// Returns the name associated with the given `NodeId`'s AST.
-    pub fn name(&self, id: NodeId) -> Name {
-        let hir_id = self.node_to_hir_id(id);
-        self.name_by_hir_id(hir_id)
-    }
-
-    // FIXME(@ljedrz): replace the `NodeId` variant.
     pub fn name_by_hir_id(&self, id: HirId) -> Name {
         match self.get_by_hir_id(id) {
             Node::Item(i) => i.ident.name,
diff --git a/src/librustc_mir/borrow_check/mod.rs b/src/librustc_mir/borrow_check/mod.rs
index ca8c4c58301..72e392fdddc 100644
--- a/src/librustc_mir/borrow_check/mod.rs
+++ b/src/librustc_mir/borrow_check/mod.rs
@@ -124,14 +124,13 @@ fn do_mir_borrowck<'a, 'tcx>(
         .flat_map(|v| v.values())
         .map(|upvar_id| {
             let var_hir_id = upvar_id.var_path.hir_id;
-            let var_node_id = tcx.hir().hir_to_node_id(var_hir_id);
             let capture = tables.upvar_capture(*upvar_id);
             let by_ref = match capture {
                 ty::UpvarCapture::ByValue => false,
                 ty::UpvarCapture::ByRef(..) => true,
             };
             let mut upvar = Upvar {
-                name: tcx.hir().name(var_node_id),
+                name: tcx.hir().name_by_hir_id(var_hir_id),
                 var_hir_id,
                 by_ref,
                 mutability: Mutability::Not,