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:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user