@@ -2086,6 +2086,7 @@ fn render_impl(
2086
2086
. split_summary_and_content ( )
2087
2087
} )
2088
2088
. unwrap_or ( ( None , None ) ) ;
2089
+
2089
2090
write ! (
2090
2091
w,
2091
2092
"{}" ,
@@ -2097,24 +2098,19 @@ fn render_impl(
2097
2098
use_absolute,
2098
2099
aliases,
2099
2100
before_dox. as_deref( ) ,
2101
+ trait_. is_none( ) && impl_. items. is_empty( ) ,
2100
2102
)
2101
2103
) ?;
2102
2104
if toggled {
2103
2105
w. write_str ( "</summary>" ) ?;
2104
2106
}
2105
2107
2106
- if before_dox. is_some ( ) {
2107
- if trait_. is_none ( ) && impl_. items . is_empty ( ) {
2108
- w. write_str (
2109
- "<div class=\" item-info\" >\
2110
- <div class=\" stab empty-impl\" >This impl block contains no items.</div>\
2111
- </div>",
2112
- ) ?;
2113
- }
2114
- if let Some ( after_dox) = after_dox {
2115
- write ! ( w, "<div class=\" docblock\" >{after_dox}</div>" ) ?;
2116
- }
2108
+ if before_dox. is_some ( )
2109
+ && let Some ( after_dox) = after_dox
2110
+ {
2111
+ write ! ( w, "<div class=\" docblock\" >{after_dox}</div>" ) ?;
2117
2112
}
2113
+
2118
2114
if !default_impl_items. is_empty ( ) || !impl_items. is_empty ( ) {
2119
2115
w. write_str ( "<div class=\" impl-items\" >" ) ?;
2120
2116
close_tags. push ( "</div>" ) ;
@@ -2182,6 +2178,7 @@ fn render_impl_summary(
2182
2178
// in documentation pages for trait with automatic implementations like "Send" and "Sync".
2183
2179
aliases : & [ String ] ,
2184
2180
doc : Option < & str > ,
2181
+ impl_is_empty : bool ,
2185
2182
) -> impl fmt:: Display {
2186
2183
fmt:: from_fn ( move |w| {
2187
2184
let inner_impl = i. inner_impl ( ) ;
@@ -2237,6 +2234,13 @@ fn render_impl_summary(
2237
2234
}
2238
2235
2239
2236
if let Some ( doc) = doc {
2237
+ if impl_is_empty {
2238
+ w. write_str (
2239
+ "<div class=\" item-info\" >\
2240
+ <div class=\" stab empty-impl\" >This impl block contains no items.</div>\
2241
+ </div>",
2242
+ ) ?;
2243
+ }
2240
2244
write ! ( w, "<div class=\" docblock\" >{doc}</div>" ) ?;
2241
2245
}
2242
2246
0 commit comments