@@ -66,13 +66,13 @@ impl<'a, 'tcx, 'rcx> RustdocVisitor<'a, 'tcx, 'rcx> {
66
66
}
67
67
}
68
68
69
- fn stability ( & self , id : ast :: NodeId ) -> Option < attr:: Stability > {
70
- self . cx . tcx . hir ( ) . opt_local_def_id ( id)
69
+ fn stability ( & self , id : hir :: HirId ) -> Option < attr:: Stability > {
70
+ self . cx . tcx . hir ( ) . opt_local_def_id_from_hir_id ( id)
71
71
. and_then ( |def_id| self . cx . tcx . lookup_stability ( def_id) ) . cloned ( )
72
72
}
73
73
74
- fn deprecation ( & self , id : ast :: NodeId ) -> Option < attr:: Deprecation > {
75
- self . cx . tcx . hir ( ) . opt_local_def_id ( id)
74
+ fn deprecation ( & self , id : hir :: HirId ) -> Option < attr:: Deprecation > {
75
+ self . cx . tcx . hir ( ) . opt_local_def_id_from_hir_id ( id)
76
76
. and_then ( |def_id| self . cx . tcx . lookup_deprecation ( def_id) )
77
77
}
78
78
@@ -83,7 +83,7 @@ impl<'a, 'tcx, 'rcx> RustdocVisitor<'a, 'tcx, 'rcx> {
83
83
krate. attrs . clone ( ) ,
84
84
Spanned { span : syntax_pos:: DUMMY_SP ,
85
85
node : hir:: VisibilityKind :: Public } ,
86
- ast :: CRATE_NODE_ID ,
86
+ hir :: CRATE_HIR_ID ,
87
87
& krate. module ,
88
88
None ) ;
89
89
// Attach the crate's exported macros to the top-level module:
@@ -105,8 +105,8 @@ impl<'a, 'tcx, 'rcx> RustdocVisitor<'a, 'tcx, 'rcx> {
105
105
struct_type,
106
106
name,
107
107
vis : item. vis . clone ( ) ,
108
- stab : self . stability ( item. id ) ,
109
- depr : self . deprecation ( item. id ) ,
108
+ stab : self . stability ( item. hir_id ) ,
109
+ depr : self . deprecation ( item. hir_id ) ,
110
110
attrs : item. attrs . clone ( ) ,
111
111
generics : generics. clone ( ) ,
112
112
fields : sd. fields ( ) . iter ( ) . cloned ( ) . collect ( ) ,
@@ -124,8 +124,8 @@ impl<'a, 'tcx, 'rcx> RustdocVisitor<'a, 'tcx, 'rcx> {
124
124
struct_type,
125
125
name,
126
126
vis : item. vis . clone ( ) ,
127
- stab : self . stability ( item. id ) ,
128
- depr : self . deprecation ( item. id ) ,
127
+ stab : self . stability ( item. hir_id ) ,
128
+ depr : self . deprecation ( item. hir_id ) ,
129
129
attrs : item. attrs . clone ( ) ,
130
130
generics : generics. clone ( ) ,
131
131
fields : sd. fields ( ) . iter ( ) . cloned ( ) . collect ( ) ,
@@ -142,14 +142,14 @@ impl<'a, 'tcx, 'rcx> RustdocVisitor<'a, 'tcx, 'rcx> {
142
142
variants : def. variants . iter ( ) . map ( |v| Variant {
143
143
name : v. node . ident . name ,
144
144
attrs : v. node . attrs . clone ( ) ,
145
- stab : self . stability ( v. node . data . id ( ) ) ,
146
- depr : self . deprecation ( v. node . data . id ( ) ) ,
145
+ stab : self . stability ( v. node . data . hir_id ( ) ) ,
146
+ depr : self . deprecation ( v. node . data . hir_id ( ) ) ,
147
147
def : v. node . data . clone ( ) ,
148
148
whence : v. span ,
149
149
} ) . collect ( ) ,
150
150
vis : it. vis . clone ( ) ,
151
- stab : self . stability ( it. id ) ,
152
- depr : self . deprecation ( it. id ) ,
151
+ stab : self . stability ( it. hir_id ) ,
152
+ depr : self . deprecation ( it. hir_id ) ,
153
153
generics : params. clone ( ) ,
154
154
attrs : it. attrs . clone ( ) ,
155
155
id : it. id ,
@@ -207,16 +207,16 @@ impl<'a, 'tcx, 'rcx> RustdocVisitor<'a, 'tcx, 'rcx> {
207
207
helpers,
208
208
attrs : item. attrs . clone ( ) ,
209
209
whence : item. span ,
210
- stab : self . stability ( item. id ) ,
211
- depr : self . deprecation ( item. id ) ,
210
+ stab : self . stability ( item. hir_id ) ,
211
+ depr : self . deprecation ( item. hir_id ) ,
212
212
} ) ;
213
213
}
214
214
None => {
215
215
om. fns . push ( Function {
216
216
id : item. id ,
217
217
vis : item. vis . clone ( ) ,
218
- stab : self . stability ( item. id ) ,
219
- depr : self . deprecation ( item. id ) ,
218
+ stab : self . stability ( item. hir_id ) ,
219
+ depr : self . deprecation ( item. hir_id ) ,
220
220
attrs : item. attrs . clone ( ) ,
221
221
decl : fd. clone ( ) ,
222
222
name,
@@ -230,7 +230,7 @@ impl<'a, 'tcx, 'rcx> RustdocVisitor<'a, 'tcx, 'rcx> {
230
230
}
231
231
232
232
pub fn visit_mod_contents ( & mut self , span : Span , attrs : hir:: HirVec < ast:: Attribute > ,
233
- vis : hir:: Visibility , id : ast :: NodeId ,
233
+ vis : hir:: Visibility , id : hir :: HirId ,
234
234
m : & hir:: Mod ,
235
235
name : Option < ast:: Name > ) -> Module {
236
236
let mut om = Module :: new ( name) ;
@@ -240,7 +240,7 @@ impl<'a, 'tcx, 'rcx> RustdocVisitor<'a, 'tcx, 'rcx> {
240
240
om. vis = vis. clone ( ) ;
241
241
om. stab = self . stability ( id) ;
242
242
om. depr = self . deprecation ( id) ;
243
- om. id = id ;
243
+ om. id = self . cx . tcx . hir ( ) . hir_to_node_id ( id ) ;
244
244
// Keep track of if there were any private modules in the path.
245
245
let orig_inside_public_path = self . inside_public_path ;
246
246
self . inside_public_path &= vis. node . is_pub ( ) ;
@@ -460,7 +460,7 @@ impl<'a, 'tcx, 'rcx> RustdocVisitor<'a, 'tcx, 'rcx> {
460
460
om. mods . push ( self . visit_mod_contents ( item. span ,
461
461
item. attrs . clone ( ) ,
462
462
item. vis . clone ( ) ,
463
- item. id ,
463
+ item. hir_id ,
464
464
m,
465
465
Some ( ident. name ) ) ) ;
466
466
} ,
@@ -481,8 +481,8 @@ impl<'a, 'tcx, 'rcx> RustdocVisitor<'a, 'tcx, 'rcx> {
481
481
attrs : item. attrs . clone ( ) ,
482
482
whence : item. span ,
483
483
vis : item. vis . clone ( ) ,
484
- stab : self . stability ( item. id ) ,
485
- depr : self . deprecation ( item. id ) ,
484
+ stab : self . stability ( item. hir_id ) ,
485
+ depr : self . deprecation ( item. hir_id ) ,
486
486
} ;
487
487
om. typedefs . push ( t) ;
488
488
} ,
@@ -494,8 +494,8 @@ impl<'a, 'tcx, 'rcx> RustdocVisitor<'a, 'tcx, 'rcx> {
494
494
attrs : item. attrs . clone ( ) ,
495
495
whence : item. span ,
496
496
vis : item. vis . clone ( ) ,
497
- stab : self . stability ( item. id ) ,
498
- depr : self . deprecation ( item. id ) ,
497
+ stab : self . stability ( item. hir_id ) ,
498
+ depr : self . deprecation ( item. hir_id ) ,
499
499
} ;
500
500
om. existentials . push ( t) ;
501
501
} ,
@@ -509,8 +509,8 @@ impl<'a, 'tcx, 'rcx> RustdocVisitor<'a, 'tcx, 'rcx> {
509
509
attrs : item. attrs . clone ( ) ,
510
510
whence : item. span ,
511
511
vis : item. vis . clone ( ) ,
512
- stab : self . stability ( item. id ) ,
513
- depr : self . deprecation ( item. id ) ,
512
+ stab : self . stability ( item. hir_id ) ,
513
+ depr : self . deprecation ( item. hir_id ) ,
514
514
} ;
515
515
om. statics . push ( s) ;
516
516
} ,
@@ -523,8 +523,8 @@ impl<'a, 'tcx, 'rcx> RustdocVisitor<'a, 'tcx, 'rcx> {
523
523
attrs : item. attrs . clone ( ) ,
524
524
whence : item. span ,
525
525
vis : item. vis . clone ( ) ,
526
- stab : self . stability ( item. id ) ,
527
- depr : self . deprecation ( item. id ) ,
526
+ stab : self . stability ( item. hir_id ) ,
527
+ depr : self . deprecation ( item. hir_id ) ,
528
528
} ;
529
529
om. constants . push ( s) ;
530
530
} ,
@@ -543,8 +543,8 @@ impl<'a, 'tcx, 'rcx> RustdocVisitor<'a, 'tcx, 'rcx> {
543
543
attrs : item. attrs . clone ( ) ,
544
544
whence : item. span ,
545
545
vis : item. vis . clone ( ) ,
546
- stab : self . stability ( item. id ) ,
547
- depr : self . deprecation ( item. id ) ,
546
+ stab : self . stability ( item. hir_id ) ,
547
+ depr : self . deprecation ( item. hir_id ) ,
548
548
} ;
549
549
om. traits . push ( t) ;
550
550
} ,
@@ -557,8 +557,8 @@ impl<'a, 'tcx, 'rcx> RustdocVisitor<'a, 'tcx, 'rcx> {
557
557
attrs : item. attrs . clone ( ) ,
558
558
whence : item. span ,
559
559
vis : item. vis . clone ( ) ,
560
- stab : self . stability ( item. id ) ,
561
- depr : self . deprecation ( item. id ) ,
560
+ stab : self . stability ( item. hir_id ) ,
561
+ depr : self . deprecation ( item. hir_id ) ,
562
562
} ;
563
563
om. trait_aliases . push ( t) ;
564
564
} ,
@@ -588,8 +588,8 @@ impl<'a, 'tcx, 'rcx> RustdocVisitor<'a, 'tcx, 'rcx> {
588
588
id : item. id ,
589
589
whence : item. span ,
590
590
vis : item. vis . clone ( ) ,
591
- stab : self . stability ( item. id ) ,
592
- depr : self . deprecation ( item. id ) ,
591
+ stab : self . stability ( item. hir_id ) ,
592
+ depr : self . deprecation ( item. hir_id ) ,
593
593
} ;
594
594
om. impls . push ( i) ;
595
595
}
@@ -609,13 +609,14 @@ impl<'a, 'tcx, 'rcx> RustdocVisitor<'a, 'tcx, 'rcx> {
609
609
let matchers = tts. chunks ( 4 ) . map ( |arm| arm[ 0 ] . span ( ) ) . collect ( ) ;
610
610
611
611
Macro {
612
- def_id : self . cx . tcx . hir ( ) . local_def_id ( def. id ) ,
612
+
613
+ def_id : self . cx . tcx . hir ( ) . local_def_id_from_hir_id ( def. hir_id ) ,
613
614
attrs : def. attrs . clone ( ) ,
614
615
name : renamed. unwrap_or ( def. name ) ,
615
616
whence : def. span ,
616
617
matchers,
617
- stab : self . stability ( def. id ) ,
618
- depr : self . deprecation ( def. id ) ,
618
+ stab : self . stability ( def. hir_id ) ,
619
+ depr : self . deprecation ( def. hir_id ) ,
619
620
imported_from : None ,
620
621
}
621
622
}
0 commit comments