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