@@ -410,7 +410,10 @@ impl<'l, 'tcx> SaveContext<'l, 'tcx> {
410
410
let mut decl_id = None ;
411
411
let mut docs = String :: new ( ) ;
412
412
let mut attrs = vec ! [ ] ;
413
- if let Some ( Node :: ImplItem ( item) ) = self . tcx . hir ( ) . find ( id) {
413
+ let hir_id = self . tcx . hir ( ) . node_to_hir_id ( id) ;
414
+ if let Some ( Node :: ImplItem ( item) ) =
415
+ self . tcx . hir ( ) . find_by_hir_id ( hir_id)
416
+ {
414
417
docs = self . docs_for_attrs ( & item. attrs ) ;
415
418
attrs = item. attrs . to_vec ( ) ;
416
419
}
@@ -451,8 +454,9 @@ impl<'l, 'tcx> SaveContext<'l, 'tcx> {
451
454
Some ( def_id) => {
452
455
let mut docs = String :: new ( ) ;
453
456
let mut attrs = vec ! [ ] ;
457
+ let hir_id = self . tcx . hir ( ) . node_to_hir_id ( id) ;
454
458
455
- if let Some ( Node :: TraitItem ( item) ) = self . tcx . hir ( ) . find ( id ) {
459
+ if let Some ( Node :: TraitItem ( item) ) = self . tcx . hir ( ) . find_by_hir_id ( hir_id ) {
456
460
docs = self . docs_for_attrs ( & item. attrs ) ;
457
461
attrs = item. attrs . to_vec ( ) ;
458
462
}
@@ -521,7 +525,8 @@ impl<'l, 'tcx> SaveContext<'l, 'tcx> {
521
525
}
522
526
match expr. node {
523
527
ast:: ExprKind :: Field ( ref sub_ex, ident) => {
524
- let hir_node = match self . tcx . hir ( ) . find ( sub_ex. id ) {
528
+ let sub_ex_hir_id = self . tcx . hir ( ) . node_to_hir_id ( sub_ex. id ) ;
529
+ let hir_node = match self . tcx . hir ( ) . find_by_hir_id ( sub_ex_hir_id) {
525
530
Some ( Node :: Expr ( expr) ) => expr,
526
531
_ => {
527
532
debug ! (
0 commit comments