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