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(
16001600 }
16011601
16021602 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+ }
16031610 write ! (
16041611 w,
16051612 "<div class=\" docblock\" >{}</div>" ,
Original file line number Diff line number Diff line change @@ -283,7 +283,8 @@ details.undocumented > summary::before {
283283
284284.stab .unstable ,
285285.stab .deprecated ,
286- .stab .portability {
286+ .stab .portability ,
287+ .stab .empty-impl {
287288 color : # c5c5c5 ;
288289 background : # 314559 !important ;
289290 border-style : none !important ;
Original file line number Diff line number Diff line change @@ -266,6 +266,7 @@ details.undocumented > summary::before {
266266 color : # ddd ;
267267}
268268
269+ .stab .empty-impl { background : # FFF5D6 ; border-color : # FFC600 ; color : # 2f2f2f ; }
269270.stab .unstable { background : # FFF5D6 ; border-color : # FFC600 ; color : # 2f2f2f ; }
270271.stab .deprecated { background : # ffc4c4 ; border-color : # db7b7b ; color : # 2f2f2f ; }
271272.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 {
255255 color : # 000 ;
256256}
257257
258+ .stab .empty-impl { background : # FFF5D6 ; border-color : # FFC600 ; }
258259.stab .unstable { background : # FFF5D6 ; border-color : # FFC600 ; }
259260.stab .deprecated { background : # ffc4c4 ; border-color : # db7b7b ; }
260261.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> {
124124impl < ' a > DocFolder for ImplStripper < ' a > {
125125 fn fold_item ( & mut self , i : Item ) -> Option < Item > {
126126 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 ( ) {
129130 return None ;
130131 }
131132 if let Some ( did) = imp. for_ . def_id ( self . cache ) {
You can’t perform that action at this time.
0 commit comments