Add support for --document-hidden-items in first_non_private

This commit is contained in:
Guillaume Gomez 2023-07-10 14:21:02 +02:00
parent 298cd366d5
commit d29afe2e14

View File

@ -1552,7 +1552,8 @@ fn first_non_private(
if let Res::Def(DefKind::Ctor(..), _) | Res::SelfCtor(..) = res {
continue;
}
if !cx.tcx.is_doc_hidden(use_def_id) &&
if (cx.render_options.document_hidden ||
!cx.tcx.is_doc_hidden(use_def_id)) &&
// We never check for "cx.render_options.document_private"
// because if a re-export is not fully public, it's never
// documented.