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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user