@@ -54,7 +54,7 @@ pub(crate) fn clean_doc_module<'tcx>(doc: &DocModule<'tcx>, cx: &mut DocContext<
54
54
let mut inserted = FxHashSet :: default ( ) ;
55
55
items. extend ( doc. foreigns . iter ( ) . map ( |( item, renamed) | {
56
56
let item = clean_maybe_renamed_foreign_item ( cx, item, * renamed) ;
57
- if let Some ( name) = item. name && !item. is_doc_hidden ( ) {
57
+ if let Some ( name) = item. name && ( cx . render_options . document_hidden || !item. is_doc_hidden ( ) ) {
58
58
inserted. insert ( ( item. type_ ( ) , name) ) ;
59
59
}
60
60
item
@@ -64,7 +64,7 @@ pub(crate) fn clean_doc_module<'tcx>(doc: &DocModule<'tcx>, cx: &mut DocContext<
64
64
return None ;
65
65
}
66
66
let item = clean_doc_module ( x, cx) ;
67
- if item. is_doc_hidden ( ) {
67
+ if !cx . render_options . document_hidden && item. is_doc_hidden ( ) {
68
68
// Hidden modules are stripped at a later stage.
69
69
// If a hidden module has the same name as a visible one, we want
70
70
// to keep both of them around.
@@ -85,7 +85,7 @@ pub(crate) fn clean_doc_module<'tcx>(doc: &DocModule<'tcx>, cx: &mut DocContext<
85
85
}
86
86
let v = clean_maybe_renamed_item ( cx, item, * renamed, * import_id) ;
87
87
for item in & v {
88
- if let Some ( name) = item. name && !item. is_doc_hidden ( ) {
88
+ if let Some ( name) = item. name && ( cx . render_options . document_hidden || !item. is_doc_hidden ( ) ) {
89
89
inserted. insert ( ( item. type_ ( ) , name) ) ;
90
90
}
91
91
}
@@ -2323,7 +2323,7 @@ fn get_all_import_attributes<'hir>(
2323
2323
attrs = import_attrs. iter ( ) . map ( |attr| ( Cow :: Borrowed ( attr) , Some ( def_id) ) ) . collect ( ) ;
2324
2324
first = false ;
2325
2325
// We don't add attributes of an intermediate re-export if it has `#[doc(hidden)]`.
2326
- } else if !cx. tcx . is_doc_hidden ( def_id) {
2326
+ } else if cx . render_options . document_hidden || !cx. tcx . is_doc_hidden ( def_id) {
2327
2327
add_without_unwanted_attributes ( & mut attrs, import_attrs, is_inline, Some ( def_id) ) ;
2328
2328
}
2329
2329
}
0 commit comments