Skip to content

Commit 1068855

Browse files
committed
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.
1 parent 1cb1f00 commit 1068855

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/librustdoc/html/render.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1244,6 +1244,10 @@ impl Context {
12441244
for item in m.items.iter() {
12451245
if self.ignore_private_item(item) { continue }
12461246

1247+
// avoid putting foreign items to the sidebar.
1248+
if let &clean::ForeignFunctionItem(..) = &item.inner { continue }
1249+
if let &clean::ForeignStaticItem(..) = &item.inner { continue }
1250+
12471251
let short = shortty(item).to_static_str();
12481252
let myname = match item.name {
12491253
None => continue,

0 commit comments

Comments
 (0)