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:
parent
1cb1f00d40
commit
1068855925
1 changed files with 4 additions and 0 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue