1
Fork 0

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:

![Screenshot from 2021-11-14 16-51-28](https://user-images.githubusercontent.com/3050060/141689100-e57123c0-bf50-4c42-adf5-d991e169a0e4.png)

cc ```@jyn514```
r? ```@camelid```
This commit is contained in:
Matthias Krüger 2022-06-06 08:36:59 +02:00 committed by GitHub
commit 77f0209fde
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 68 additions and 19 deletions

View file

@ -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>",