Skip to content

Commit 468647c

Browse files
committed
remove hir::map::name
1 parent f6eb392 commit 468647c

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

src/librustc/hir/map/mod.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -940,13 +940,6 @@ impl<'hir> Map<'hir> {
940940
}
941941
}
942942

943-
/// Returns the name associated with the given `NodeId`'s AST.
944-
pub fn name(&self, id: NodeId) -> Name {
945-
let hir_id = self.node_to_hir_id(id);
946-
self.name_by_hir_id(hir_id)
947-
}
948-
949-
// FIXME(@ljedrz): replace the `NodeId` variant.
950943
pub fn name_by_hir_id(&self, id: HirId) -> Name {
951944
match self.get_by_hir_id(id) {
952945
Node::Item(i) => i.ident.name,

src/librustc_mir/borrow_check/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,13 @@ fn do_mir_borrowck<'a, 'tcx>(
124124
.flat_map(|v| v.values())
125125
.map(|upvar_id| {
126126
let var_hir_id = upvar_id.var_path.hir_id;
127-
let var_node_id = tcx.hir().hir_to_node_id(var_hir_id);
128127
let capture = tables.upvar_capture(*upvar_id);
129128
let by_ref = match capture {
130129
ty::UpvarCapture::ByValue => false,
131130
ty::UpvarCapture::ByRef(..) => true,
132131
};
133132
let mut upvar = Upvar {
134-
name: tcx.hir().name(var_node_id),
133+
name: tcx.hir().name_by_hir_id(var_hir_id),
135134
var_hir_id,
136135
by_ref,
137136
mutability: Mutability::Not,

0 commit comments

Comments
 (0)