diff options
| author | Kevin Ballard <kevin@sb.org> | 2014-02-11 14:29:23 -0800 |
|---|---|---|
| committer | Kevin Ballard <kevin@sb.org> | 2014-02-14 10:50:19 -0800 |
| commit | 52a3d38796c616bbed39cda2dc3538f2cedbd5ac (patch) | |
| tree | c66fd309d0fdc22dc67a402c5a6e6881bfe5d77d | |
| parent | 92c5738aae54a15717005e84499a522d173a4a09 (diff) | |
| download | rust-52a3d38796c616bbed39cda2dc3538f2cedbd5ac.tar.gz rust-52a3d38796c616bbed39cda2dc3538f2cedbd5ac.zip | |
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.
| -rw-r--r-- | src/librustdoc/passes.rs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/librustdoc/passes.rs b/src/librustdoc/passes.rs index 30643737078..fce4cab52c9 100644 --- a/src/librustdoc/passes.rs +++ b/src/librustdoc/passes.rs @@ -110,8 +110,16 @@ impl<'a> fold::DocFolder for Stripper<'a> { // 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 { |
