Only show restricted pub use

This commit is contained in:
Guillaume Gomez 2021-07-07 13:47:28 +02:00
parent e7bc2a012a
commit 74d71c204f
2 changed files with 7 additions and 1 deletions

View File

@ -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)

View File

@ -46,3 +46,8 @@
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;
}