@@ -71,7 +71,7 @@ pub(crate) fn clean_doc_module<'tcx>(doc: &DocModule<'tcx>, cx: &mut DocContext<
7171 items. extend ( doc. foreigns . iter ( ) . map ( |( item, renamed, import_id) | {
7272 let item = clean_maybe_renamed_foreign_item ( cx, item, * renamed, * import_id) ;
7373 if let Some ( name) = item. name
74- && ( cx. render_options . document_hidden || !item. is_doc_hidden ( ) )
74+ && ( cx. document_hidden ( ) || !item. is_doc_hidden ( ) )
7575 {
7676 inserted. insert ( ( item. type_ ( ) , name) ) ;
7777 }
@@ -82,7 +82,7 @@ pub(crate) fn clean_doc_module<'tcx>(doc: &DocModule<'tcx>, cx: &mut DocContext<
8282 return None ;
8383 }
8484 let item = clean_doc_module ( x, cx) ;
85- if !cx. render_options . document_hidden && item. is_doc_hidden ( ) {
85+ if !cx. document_hidden ( ) && item. is_doc_hidden ( ) {
8686 // Hidden modules are stripped at a later stage.
8787 // If a hidden module has the same name as a visible one, we want
8888 // to keep both of them around.
@@ -104,7 +104,7 @@ pub(crate) fn clean_doc_module<'tcx>(doc: &DocModule<'tcx>, cx: &mut DocContext<
104104 let v = clean_maybe_renamed_item ( cx, item, * renamed, import_ids) ;
105105 for item in & v {
106106 if let Some ( name) = item. name
107- && ( cx. render_options . document_hidden || !item. is_doc_hidden ( ) )
107+ && ( cx. document_hidden ( ) || !item. is_doc_hidden ( ) )
108108 {
109109 inserted. insert ( ( item. type_ ( ) , name) ) ;
110110 }
@@ -203,7 +203,7 @@ fn generate_item_with_correct_attrs(
203203 . get_word_attr ( sym:: inline)
204204 . is_some ( )
205205 || ( is_glob_import ( cx. tcx , import_id)
206- && ( cx. render_options . document_hidden || !cx. tcx . is_doc_hidden ( def_id) ) ) ;
206+ && ( cx. document_hidden ( ) || !cx. tcx . is_doc_hidden ( def_id) ) ) ;
207207 attrs. extend ( get_all_import_attributes ( cx, import_id, def_id, is_inline) ) ;
208208 is_inline = is_inline || import_is_inline;
209209 }
@@ -1588,9 +1588,9 @@ fn first_non_private<'tcx>(
15881588 if let Res :: Def ( DefKind :: Ctor ( ..) , _) | Res :: SelfCtor ( ..) = res {
15891589 continue ;
15901590 }
1591- if ( cx. render_options . document_hidden ||
1591+ if ( cx. document_hidden ( ) ||
15921592 !cx. tcx . is_doc_hidden ( use_def_id) ) &&
1593- // We never check for "cx.render_options. document_private"
1593+ // We never check for "cx.document_private() "
15941594 // because if a re-export is not fully public, it's never
15951595 // documented.
15961596 cx. tcx . local_visibility ( local_use_def_id) . is_public ( )
@@ -2634,7 +2634,7 @@ fn get_all_import_attributes<'hir>(
26342634 attrs = import_attrs. iter ( ) . map ( |attr| ( Cow :: Borrowed ( attr) , Some ( def_id) ) ) . collect ( ) ;
26352635 first = false ;
26362636 // We don't add attributes of an intermediate re-export if it has `#[doc(hidden)]`.
2637- } else if cx. render_options . document_hidden || !cx. tcx . is_doc_hidden ( def_id) {
2637+ } else if cx. document_hidden ( ) || !cx. tcx . is_doc_hidden ( def_id) {
26382638 add_without_unwanted_attributes ( & mut attrs, import_attrs, is_inline, Some ( def_id) ) ;
26392639 }
26402640 }
@@ -3075,8 +3075,7 @@ fn clean_use_statement_inner<'tcx>(
30753075 // #[doc(no_inline)] attribute is present.
30763076 // Don't inline doc(hidden) imports so they can be stripped at a later stage.
30773077 let mut denied = cx. is_json_output ( )
3078- || !( visibility. is_public ( )
3079- || ( cx. render_options . document_private && is_visible_from_parent_mod) )
3078+ || !( visibility. is_public ( ) || ( cx. document_private ( ) && is_visible_from_parent_mod) )
30803079 || pub_underscore
30813080 || attrs. iter ( ) . any ( |a| {
30823081 a. has_name ( sym:: doc)
0 commit comments