rustdoc: Only hide possibly private modules
If an empty public module has no documentation, it shouldn't emit a page that's just a redirect loop to itself! Closes #16265
This commit is contained in:
parent
c47bb7cd50
commit
fcc89ea500
3 changed files with 36 additions and 1 deletions
|
@ -1352,7 +1352,9 @@ impl Context {
|
|||
fn ignore_private_item(&self, it: &clean::Item) -> bool {
|
||||
match it.inner {
|
||||
clean::ModuleItem(ref m) => {
|
||||
(m.items.len() == 0 && it.doc_value().is_none()) ||
|
||||
(m.items.len() == 0 &&
|
||||
it.doc_value().is_none() &&
|
||||
it.visibility != Some(ast::Public)) ||
|
||||
(self.passes.contains("strip-private") && it.visibility != Some(ast::Public))
|
||||
}
|
||||
clean::PrimitiveItem(..) => it.visibility != Some(ast::Public),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue