remove hir::map::name
This commit is contained in:
parent
f6eb39203b
commit
468647cabb
@ -940,13 +940,6 @@ pub fn expect_expr_by_hir_id(&self, id: HirId) -> &'hir Expr {
|
||||
}
|
||||
}
|
||||
|
||||
/// 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,
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user