Skip to content

Commit 74d71c2

Browse files
Only show restricted pub use
1 parent e7bc2a0 commit 74d71c2

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Diff for: src/librustdoc/clean/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -2053,7 +2053,8 @@ fn clean_use_statement(
20532053
// forcefully don't inline if this is not public or if the
20542054
// #[doc(no_inline)] attribute is present.
20552055
// Don't inline doc(hidden) imports so they can be stripped at a later stage.
2056-
let mut denied = (!import.vis.node.is_pub() && !cx.render_options.document_private)
2056+
let mut denied = !(import.vis.node.is_pub()
2057+
|| (cx.render_options.document_private && import.vis.node.is_pub_restricted()))
20572058
|| pub_underscore
20582059
|| attrs.iter().any(|a| {
20592060
a.has_name(sym::doc)

Diff for: src/test/rustdoc/reexports-priv.rs

+5
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,8 @@ pub use reexports::Union;
4646
pub(crate) use reexports::UnionCrate;
4747
// @has 'foo/union.UnionSelf.html' '//*[@class="docblock type-decl"]' 'pub(crate) union UnionSelf {'
4848
pub(self) use reexports::UnionSelf;
49+
50+
pub mod foo {
51+
// @!has 'foo/foo/union.Union.html'
52+
use crate::reexports::Union;
53+
}

0 commit comments

Comments
 (0)