mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-22 10:05:06 +03:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user