File tree Expand file tree Collapse file tree 2 files changed +1
-9
lines changed
librustc_mir/borrow_check Expand file tree Collapse file tree 2 files changed +1
-9
lines changed Original file line number Diff line number Diff line change @@ -940,13 +940,6 @@ impl<'hir> Map<'hir> {
940
940
}
941
941
}
942
942
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.
950
943
pub fn name_by_hir_id ( & self , id : HirId ) -> Name {
951
944
match self . get_by_hir_id ( id) {
952
945
Node :: Item ( i) => i. ident . name ,
Original file line number Diff line number Diff line change @@ -124,14 +124,13 @@ fn do_mir_borrowck<'a, 'tcx>(
124
124
. flat_map ( |v| v. values ( ) )
125
125
. map ( |upvar_id| {
126
126
let var_hir_id = upvar_id. var_path . hir_id ;
127
- let var_node_id = tcx. hir ( ) . hir_to_node_id ( var_hir_id) ;
128
127
let capture = tables. upvar_capture ( * upvar_id) ;
129
128
let by_ref = match capture {
130
129
ty:: UpvarCapture :: ByValue => false ,
131
130
ty:: UpvarCapture :: ByRef ( ..) => true ,
132
131
} ;
133
132
let mut upvar = Upvar {
134
- name : tcx. hir ( ) . name ( var_node_id ) ,
133
+ name : tcx. hir ( ) . name_by_hir_id ( var_hir_id ) ,
135
134
var_hir_id,
136
135
by_ref,
137
136
mutability : Mutability :: Not ,
You can’t perform that action at this time.
0 commit comments