Skip to content

Commit

Permalink
auto merge of #17846 : tomjakubowski/rust/rustdoc-hide-private-traits…
Browse files Browse the repository at this point in the history
…, r=alexcrichton

Fix #16563
  • Loading branch information
bors committed Oct 22, 2014
2 parents 1d64756 + 370c9c5 commit 9f0c29a
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/librustdoc/passes.rs
Expand Up @@ -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) {
Expand Down

0 comments on commit 9f0c29a

Please sign in to comment.