diff options
| author | bors <bors@rust-lang.org> | 2021-12-17 06:03:38 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-12-17 06:03:38 +0000 |
| commit | 16d8a91d511b0e90391bcb20b8c67036071d9392 (patch) | |
| tree | 7bd13b400dfbcc8915c6fc1262a1fd987d5db596 /src/librustdoc/html/render | |
| parent | 9b45f04414f3e4006fc2ed3d8e1fa7708efe0e53 (diff) | |
| parent | 719d7a53751eb2eb4166c9f272507b345aa444ef (diff) | |
| download | rust-16d8a91d511b0e90391bcb20b8c67036071d9392.tar.gz rust-16d8a91d511b0e90391bcb20b8c67036071d9392.zip | |
Auto merge of #91812 - camelid:assoc-const-lazy, r=GuillaumeGomez
rustdoc: Pretty-print assoc const defaults on-demand This should improve performance, clean up the code, and help pave the way for #83035.
Diffstat (limited to 'src/librustdoc/html/render')
| -rw-r--r-- | src/librustdoc/html/render/mod.rs | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs index c67fe1fef40..2432f5cc085 100644 --- a/src/librustdoc/html/render/mod.rs +++ b/src/librustdoc/html/render/mod.rs @@ -762,7 +762,6 @@ fn assoc_const( w: &mut Buffer, it: &clean::Item, ty: &clean::Type, - _default: Option<&String>, link: AssocItemLink<'_>, extra: &str, cx: &Context<'_>, @@ -958,15 +957,9 @@ fn render_assoc_item( clean::MethodItem(ref m, _) => { method(w, item, m.header, &m.generics, &m.decl, link, parent, cx, render_mode) } - clean::AssocConstItem(ref ty, ref default) => assoc_const( - w, - item, - ty, - default.as_ref(), - link, - if parent == ItemType::Trait { " " } else { "" }, - cx, - ), + clean::AssocConstItem(ref ty, _) => { + assoc_const(w, item, ty, link, if parent == ItemType::Trait { " " } else { "" }, cx) + } clean::AssocTypeItem(ref bounds, ref default) => assoc_type( w, item, @@ -1467,7 +1460,7 @@ fn render_impl( w.write_str("</h4>"); w.write_str("</div>"); } - clean::AssocConstItem(ref ty, ref default) => { + clean::AssocConstItem(ref ty, _) => { let source_id = format!("{}.{}", item_type, name); let id = cx.derive_id(source_id.clone()); write!( @@ -1482,7 +1475,6 @@ fn render_impl( w, item, ty, - default.as_ref(), link.anchor(if trait_.is_some() { &source_id } else { &id }), "", cx, |
