Skip to content

Commit

Permalink
Only show restricted pub use
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Jul 7, 2021
1 parent e7bc2a0 commit 74d71c2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/librustdoc/clean/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2053,7 +2053,8 @@ fn clean_use_statement(
// forcefully don't inline if this is not public or if the
// #[doc(no_inline)] attribute is present.
// Don't inline doc(hidden) imports so they can be stripped at a later stage.
let mut denied = (!import.vis.node.is_pub() && !cx.render_options.document_private)
let mut denied = !(import.vis.node.is_pub()
|| (cx.render_options.document_private && import.vis.node.is_pub_restricted()))
|| pub_underscore
|| attrs.iter().any(|a| {
a.has_name(sym::doc)
Expand Down
5 changes: 5 additions & 0 deletions src/test/rustdoc/reexports-priv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,8 @@ pub use reexports::Union;
pub(crate) use reexports::UnionCrate;
// @has 'foo/union.UnionSelf.html' '//*[@class="docblock type-decl"]' 'pub(crate) union UnionSelf {'
pub(self) use reexports::UnionSelf;

pub mod foo {
// @!has 'foo/foo/union.Union.html'
use crate::reexports::Union;
}

0 comments on commit 74d71c2

Please sign in to comment.