diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-06-06 08:36:59 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-06 08:36:59 +0200 |
| commit | 77f0209fde995458d39dbd5f58699b8ddfd04452 (patch) | |
| tree | 63f67d5968d9f4363b11091f53595f3453a3629b /src/librustdoc/html/render | |
| parent | 760237ff785fd14ac7fdab799f4d695d86cf9cbf (diff) | |
| parent | eca12e33e9aca609b6409625f6a617d03bc479d3 (diff) | |
| download | rust-77f0209fde995458d39dbd5f58699b8ddfd04452.tar.gz rust-77f0209fde995458d39dbd5f58699b8ddfd04452.zip | |
Rollup merge of #90905 - GuillaumeGomez:empty-impl-blocks, r=jsha
Add empty impl blocks if they have documentation Fixes https://github.com/rust-lang/rust/issues/90866. The update for the test script is needed to count the number of impl blocks we have with only the struct. To be noted that with https://github.com/rust-lang/rust/pull/89676 merged, it wouldn't be needed (I don't know what is the status of it btw. cc ```@Mark-Simulacrum).``` It looks like this:  cc ```@jyn514``` r? ```@camelid```
Diffstat (limited to 'src/librustdoc/html/render')
| -rw-r--r-- | src/librustdoc/html/render/mod.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs index 23ce634cf28..cb887d16906 100644 --- a/src/librustdoc/html/render/mod.rs +++ b/src/librustdoc/html/render/mod.rs @@ -1600,6 +1600,13 @@ fn render_impl( } if let Some(ref dox) = i.impl_item.collapsed_doc_value() { + if trait_.is_none() && i.inner_impl().items.is_empty() { + w.write_str( + "<div class=\"item-info\">\ + <div class=\"stab empty-impl\">This impl block contains no items.</div> + </div>", + ); + } write!( w, "<div class=\"docblock\">{}</div>", |
