File tree Expand file tree Collapse file tree 5 files changed +14
-3
lines changed Expand file tree Collapse file tree 5 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -1600,6 +1600,13 @@ fn render_impl(
1600
1600
}
1601
1601
1602
1602
if let Some ( ref dox) = i. impl_item . collapsed_doc_value ( ) {
1603
+ if trait_. is_none ( ) && i. inner_impl ( ) . items . is_empty ( ) {
1604
+ w. write_str (
1605
+ "<div class=\" item-info\" >\
1606
+ <div class=\" stab empty-impl\" >This impl block contains no items.</div>
1607
+ </div>" ,
1608
+ ) ;
1609
+ }
1603
1610
write ! (
1604
1611
w,
1605
1612
"<div class=\" docblock\" >{}</div>" ,
Original file line number Diff line number Diff line change @@ -283,7 +283,8 @@ details.undocumented > summary::before {
283
283
284
284
.stab .unstable ,
285
285
.stab .deprecated ,
286
- .stab .portability {
286
+ .stab .portability ,
287
+ .stab .empty-impl {
287
288
color : # c5c5c5 ;
288
289
background : # 314559 !important ;
289
290
border-style : none !important ;
Original file line number Diff line number Diff line change @@ -266,6 +266,7 @@ details.undocumented > summary::before {
266
266
color : # ddd ;
267
267
}
268
268
269
+ .stab .empty-impl { background : # FFF5D6 ; border-color : # FFC600 ; color : # 2f2f2f ; }
269
270
.stab .unstable { background : # FFF5D6 ; border-color : # FFC600 ; color : # 2f2f2f ; }
270
271
.stab .deprecated { background : # ffc4c4 ; border-color : # db7b7b ; color : # 2f2f2f ; }
271
272
.stab .portability { background : # F3DFFF ; border-color : # b07bdb ; color : # 2f2f2f ; }
Original file line number Diff line number Diff line change @@ -255,6 +255,7 @@ details.undocumented > summary::before {
255
255
color : # 000 ;
256
256
}
257
257
258
+ .stab .empty-impl { background : # FFF5D6 ; border-color : # FFC600 ; }
258
259
.stab .unstable { background : # FFF5D6 ; border-color : # FFC600 ; }
259
260
.stab .deprecated { background : # ffc4c4 ; border-color : # db7b7b ; }
260
261
.stab .portability { background : # F3DFFF ; border-color : # b07bdb ; }
Original file line number Diff line number Diff line change @@ -124,8 +124,9 @@ pub(crate) struct ImplStripper<'a> {
124
124
impl < ' a > DocFolder for ImplStripper < ' a > {
125
125
fn fold_item ( & mut self , i : Item ) -> Option < Item > {
126
126
if let clean:: ImplItem ( ref imp) = * i. kind {
127
- // emptied none trait impls can be stripped
128
- if imp. trait_ . is_none ( ) && imp. items . is_empty ( ) {
127
+ // Impl blocks can be skipped if they are: empty; not a trait impl; and have no
128
+ // documentation.
129
+ if imp. trait_ . is_none ( ) && imp. items . is_empty ( ) && i. doc_value ( ) . is_none ( ) {
129
130
return None ;
130
131
}
131
132
if let Some ( did) = imp. for_ . def_id ( self . cache ) {
You can’t perform that action at this time.
0 commit comments