@@ -233,8 +233,7 @@ impl<'l, 'tcx, 'll, O: DumpOutput + 'll> DumpVisitor<'l, 'tcx, 'll, O> {
233
233
}
234
234
235
235
fn lookup_def_id ( & self , ref_id : NodeId ) -> Option < DefId > {
236
- let hir_id = self . save_ctxt . tcx . hir ( ) . node_to_hir_id ( ref_id) ;
237
- match self . save_ctxt . get_path_res ( hir_id) {
236
+ match self . save_ctxt . get_path_res ( ref_id) {
238
237
Res :: PrimTy ( ..) | Res :: SelfTy ( ..) | Res :: Err => None ,
239
238
def => Some ( def. def_id ( ) ) ,
240
239
}
@@ -887,8 +886,7 @@ impl<'l, 'tcx, 'll, O: DumpOutput + 'll> DumpVisitor<'l, 'tcx, 'll, O> {
887
886
return ;
888
887
}
889
888
} ;
890
- let hir_id = self . save_ctxt . tcx . hir ( ) . node_to_hir_id ( p. id ) ;
891
- let variant = adt. variant_of_res ( self . save_ctxt . get_path_res ( hir_id) ) ;
889
+ let variant = adt. variant_of_res ( self . save_ctxt . get_path_res ( p. id ) ) ;
892
890
893
891
for & Spanned { node : ref field, .. } in fields {
894
892
if let Some ( index) = self . tcx . find_field_index ( field. ident , variant) {
@@ -918,8 +916,7 @@ impl<'l, 'tcx, 'll, O: DumpOutput + 'll> DumpVisitor<'l, 'tcx, 'll, O> {
918
916
919
917
// process collected paths
920
918
for ( id, ident, immut) in collector. collected_idents {
921
- let hir_id = self . save_ctxt . tcx . hir ( ) . node_to_hir_id ( id) ;
922
- match self . save_ctxt . get_path_res ( hir_id) {
919
+ match self . save_ctxt . get_path_res ( id) {
923
920
Res :: Local ( hir_id) => {
924
921
let mut value = if immut == ast:: Mutability :: Immutable {
925
922
self . span . snippet ( ident. span )
@@ -1543,7 +1540,8 @@ impl<'l, 'tcx, 'll, O: DumpOutput + 'll> Visitor<'l> for DumpVisitor<'l, 'tcx, '
1543
1540
return ;
1544
1541
}
1545
1542
} ;
1546
- let res = self . save_ctxt . get_path_res ( hir_expr. hir_id ) ;
1543
+ let node_id = self . save_ctxt . tcx . hir ( ) . hir_to_node_id ( hir_expr. hir_id ) ;
1544
+ let res = self . save_ctxt . get_path_res ( node_id) ;
1547
1545
self . process_struct_lit ( ex, path, fields, adt. variant_of_res ( res) , base)
1548
1546
}
1549
1547
ast:: ExprKind :: MethodCall ( ref seg, ref args) => self . process_method_call ( ex, seg, args) ,
0 commit comments