1
Fork 0

rustdoc: Avoid rendering foreign items to the sidebar.

Otherwise the generated documentation is 30% larger. The sidebar
renders an entry for each item to all items, so large modules have
O(n^2) items rendered in the sidebars. Not a correct solution, but
at least it works.
This commit is contained in:
Kang Seonghoon 2014-12-04 00:51:19 +09:00
parent 1cb1f00d40
commit 1068855925

View file

@ -1244,6 +1244,10 @@ impl Context {
for item in m.items.iter() {
if self.ignore_private_item(item) { continue }
// avoid putting foreign items to the sidebar.
if let &clean::ForeignFunctionItem(..) = &item.inner { continue }
if let &clean::ForeignStaticItem(..) = &item.inner { continue }
let short = shortty(item).to_static_str();
let myname = match item.name {
None => continue,