@@ -233,7 +233,8 @@ 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- match self . save_ctxt . get_path_res ( ref_id) {
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) {
237238 Res :: PrimTy ( ..) | Res :: SelfTy ( ..) | Res :: Err => None ,
238239 def => Some ( def. def_id ( ) ) ,
239240 }
@@ -886,7 +887,8 @@ impl<'l, 'tcx, 'll, O: DumpOutput + 'll> DumpVisitor<'l, 'tcx, 'll, O> {
886887 return ;
887888 }
888889 } ;
889- let variant = adt. variant_of_res ( self . save_ctxt . get_path_res ( p. id ) ) ;
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) ) ;
890892
891893 for & Spanned { node : ref field, .. } in fields {
892894 if let Some ( index) = self . tcx . find_field_index ( field. ident , variant) {
@@ -916,7 +918,8 @@ impl<'l, 'tcx, 'll, O: DumpOutput + 'll> DumpVisitor<'l, 'tcx, 'll, O> {
916918
917919 // process collected paths
918920 for ( id, ident, immut) in collector. collected_idents {
919- match self . save_ctxt . get_path_res ( id) {
921+ let hir_id = self . save_ctxt . tcx . hir ( ) . node_to_hir_id ( id) ;
922+ match self . save_ctxt . get_path_res ( hir_id) {
920923 Res :: Local ( hir_id) => {
921924 let mut value = if immut == ast:: Mutability :: Immutable {
922925 self . span . snippet ( ident. span )
@@ -1540,8 +1543,7 @@ impl<'l, 'tcx, 'll, O: DumpOutput + 'll> Visitor<'l> for DumpVisitor<'l, 'tcx, '
15401543 return ;
15411544 }
15421545 } ;
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) ;
1546+ let res = self . save_ctxt . get_path_res ( hir_expr. hir_id ) ;
15451547 self . process_struct_lit ( ex, path, fields, adt. variant_of_res ( res) , base)
15461548 }
15471549 ast:: ExprKind :: MethodCall ( ref seg, ref args) => self . process_method_call ( ex, seg, args) ,
0 commit comments