@@ -233,8 +233,7 @@ impl<'l, 'tcx, 'll, O: DumpOutput + 'll> DumpVisitor<'l, 'tcx, 'll, O> {
233233 }
234234
235235 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) {
238237 Res :: PrimTy ( ..) | Res :: SelfTy ( ..) | Res :: Err => None ,
239238 def => Some ( def. def_id ( ) ) ,
240239 }
@@ -887,8 +886,7 @@ impl<'l, 'tcx, 'll, O: DumpOutput + 'll> DumpVisitor<'l, 'tcx, 'll, O> {
887886 return ;
888887 }
889888 } ;
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 ) ) ;
892890
893891 for & Spanned { node : ref field, .. } in fields {
894892 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> {
918916
919917 // process collected paths
920918 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) {
923920 Res :: Local ( hir_id) => {
924921 let mut value = if immut == ast:: Mutability :: Immutable {
925922 self . span . snippet ( ident. span )
@@ -1543,7 +1540,8 @@ impl<'l, 'tcx, 'll, O: DumpOutput + 'll> Visitor<'l> for DumpVisitor<'l, 'tcx, '
15431540 return ;
15441541 }
15451542 } ;
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) ;
15471545 self . process_struct_lit ( ex, path, fields, adt. variant_of_res ( res) , base)
15481546 }
15491547 ast:: ExprKind :: MethodCall ( ref seg, ref args) => self . process_method_call ( ex, seg, args) ,
0 commit comments