1
Fork 0

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:
Alex Crichton 2015-04-06 16:43:55 -07:00
parent c47bb7cd50
commit fcc89ea500
3 changed files with 36 additions and 1 deletions

View file

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