rustdoc: hide private traits in strip-private pass

Fix #16563
This commit is contained in:
Tom Jakubowski 2014-10-07 08:36:55 -07:00
parent b69cd73b7b
commit 370c9c54c2

View File

@ -134,7 +134,18 @@ impl<'a> fold::DocFolder for Stripper<'a> {
clean::StructItem(..) | clean::EnumItem(..) |
clean::TraitItem(..) | clean::FunctionItem(..) |
clean::VariantItem(..) | clean::MethodItem(..) |
clean::ForeignFunctionItem(..) | clean::ForeignStaticItem(..) |
clean::ForeignFunctionItem(..) | clean::ForeignStaticItem(..) => {
if ast_util::is_local(i.def_id) {
if !self.exported_items.contains(&i.def_id.node) {
return None;
}
// Traits are in exported_items even when they're totally private.
if i.is_trait() && i.visibility != Some(ast::Public) {
return None;
}
}
}
clean::ConstantItem(..) => {
if ast_util::is_local(i.def_id) &&
!self.exported_items.contains(&i.def_id.node) {