@@ -16,6 +16,7 @@ use rustc_span::Span;
16
16
17
17
use std:: mem;
18
18
19
+ use crate :: clean:: utils:: { inherits_doc_hidden, should_ignore_res} ;
19
20
use crate :: clean:: { cfg:: Cfg , reexport_chain, AttributesExt , NestedAttributesExt } ;
20
21
use crate :: core;
21
22
@@ -73,38 +74,6 @@ fn def_id_to_path(tcx: TyCtxt<'_>, did: DefId) -> Vec<Symbol> {
73
74
std:: iter:: once ( crate_name) . chain ( relative) . collect ( )
74
75
}
75
76
76
- pub ( crate ) fn inherits_doc_hidden (
77
- tcx : TyCtxt < ' _ > ,
78
- mut def_id : LocalDefId ,
79
- stop_at : Option < LocalDefId > ,
80
- ) -> bool {
81
- let hir = tcx. hir ( ) ;
82
- while let Some ( id) = tcx. opt_local_parent ( def_id) {
83
- if let Some ( stop_at) = stop_at && id == stop_at {
84
- return false ;
85
- }
86
- def_id = id;
87
- if tcx. is_doc_hidden ( def_id. to_def_id ( ) ) {
88
- return true ;
89
- } else if let Some ( node) = hir. find_by_def_id ( def_id) &&
90
- matches ! (
91
- node,
92
- hir:: Node :: Item ( hir:: Item { kind: hir:: ItemKind :: Impl ( _) , .. } ) ,
93
- )
94
- {
95
- // `impl` blocks stand a bit on their own: unless they have `#[doc(hidden)]` directly
96
- // on them, they don't inherit it from the parent context.
97
- return false ;
98
- }
99
- }
100
- false
101
- }
102
-
103
- #[ inline]
104
- pub ( crate ) fn should_ignore_res ( res : Res ) -> bool {
105
- matches ! ( res, Res :: Def ( DefKind :: Ctor ( ..) , _) | Res :: SelfCtor ( ..) )
106
- }
107
-
108
77
pub ( crate ) struct RustdocVisitor < ' a , ' tcx > {
109
78
cx : & ' a mut core:: DocContext < ' tcx > ,
110
79
view_item_stack : LocalDefIdSet ,
0 commit comments