@@ -31,7 +31,7 @@ pub struct RustdocVisitor<'a, 'tcx: 'a, 'rcx: 'a> {
31
31
pub module : Module ,
32
32
pub attrs : hir:: HirVec < ast:: Attribute > ,
33
33
pub cx : & ' a core:: DocContext < ' a , ' tcx , ' rcx > ,
34
- view_item_stack : FxHashSet < ast :: NodeId > ,
34
+ view_item_stack : FxHashSet < hir :: HirId > ,
35
35
inlining : bool ,
36
36
/// Are the current module and all of its parents public?
37
37
inside_public_path : bool ,
@@ -44,7 +44,7 @@ impl<'a, 'tcx, 'rcx> RustdocVisitor<'a, 'tcx, 'rcx> {
44
44
) -> RustdocVisitor < ' a , ' tcx , ' rcx > {
45
45
// If the root is re-exported, terminate all recursion.
46
46
let mut stack = FxHashSet :: default ( ) ;
47
- stack. insert ( ast :: CRATE_NODE_ID ) ;
47
+ stack. insert ( hir :: CRATE_HIR_ID ) ;
48
48
RustdocVisitor {
49
49
module : Module :: new ( None ) ,
50
50
attrs : hir:: HirVec :: new ( ) ,
@@ -269,13 +269,13 @@ impl<'a, 'tcx, 'rcx> RustdocVisitor<'a, 'tcx, 'rcx> {
269
269
om : & mut Module ,
270
270
please_inline : bool ) -> bool {
271
271
272
- fn inherits_doc_hidden ( cx : & core:: DocContext < ' _ , ' _ , ' _ > , mut node : ast :: NodeId ) -> bool {
272
+ fn inherits_doc_hidden ( cx : & core:: DocContext < ' _ , ' _ , ' _ > , mut node : hir :: HirId ) -> bool {
273
273
while let Some ( id) = cx. tcx . hir ( ) . get_enclosing_scope ( node) {
274
274
node = id;
275
275
if cx. tcx . hir ( ) . attrs ( node) . lists ( "doc" ) . has_word ( "hidden" ) {
276
276
return true ;
277
277
}
278
- if node == ast :: CRATE_NODE_ID {
278
+ if node == hir :: CRATE_HIR_ID {
279
279
break ;
280
280
}
281
281
}
@@ -324,21 +324,21 @@ impl<'a, 'tcx, 'rcx> RustdocVisitor<'a, 'tcx, 'rcx> {
324
324
return false
325
325
}
326
326
327
- let def_node_id = match tcx. hir ( ) . as_local_node_id ( def_did) {
327
+ let def_hir_id = match tcx. hir ( ) . as_local_hir_id ( def_did) {
328
328
Some ( n) => n, None => return false
329
329
} ;
330
330
331
331
let is_private = !self . cx . renderinfo . borrow ( ) . access_levels . is_public ( def_did) ;
332
- let is_hidden = inherits_doc_hidden ( self . cx , def_node_id ) ;
332
+ let is_hidden = inherits_doc_hidden ( self . cx , def_hir_id ) ;
333
333
334
334
// Only inline if requested or if the item would otherwise be stripped.
335
335
if ( !please_inline && !is_private && !is_hidden) || is_no_inline {
336
336
return false
337
337
}
338
338
339
- if !self . view_item_stack . insert ( def_node_id ) { return false }
339
+ if !self . view_item_stack . insert ( def_hir_id ) { return false }
340
340
341
- let ret = match tcx. hir ( ) . get ( def_node_id ) {
341
+ let ret = match tcx. hir ( ) . get_by_hir_id ( def_hir_id ) {
342
342
Node :: Item ( & hir:: Item { node : hir:: ItemKind :: Mod ( ref m) , .. } ) if glob => {
343
343
let prev = mem:: replace ( & mut self . inlining , true ) ;
344
344
for i in & m. item_ids {
@@ -371,7 +371,7 @@ impl<'a, 'tcx, 'rcx> RustdocVisitor<'a, 'tcx, 'rcx> {
371
371
}
372
372
_ => false ,
373
373
} ;
374
- self . view_item_stack . remove ( & def_node_id ) ;
374
+ self . view_item_stack . remove ( & def_hir_id ) ;
375
375
ret
376
376
}
377
377
0 commit comments