rustdoc: Strip impls of stripped private types

In strip-private, also strip impls of traits for private types. This
fixes the search index so searching for "drop", "eq", etc doesn't throw
an exception.
This commit is contained in:
Kevin Ballard 2014-02-11 14:29:23 -08:00
parent 92c5738aae
commit 52a3d38796

View File

@ -110,8 +110,16 @@ fn fold_item(&mut self, i: Item) -> Option<Item> {
// handled below
clean::ModuleItem(..) => {}
// impls/tymethods have no control over privacy
clean::ImplItem(..) | clean::TyMethodItem(..) => {}
// trait impls for private items should be stripped
clean::ImplItem(clean::Impl{ for_: clean::ResolvedPath{ id: ref for_id, .. }, .. }) => {
if !self.exported_items.contains(for_id) {
return None;
}
}
clean::ImplItem(..) => {}
// tymethods have no control over privacy
clean::TyMethodItem(..) => {}
}
let fastreturn = match i.inner {