@@ -1880,10 +1880,17 @@ fn render_markdown(
1880
1880
fn document_short (
1881
1881
w : & mut Buffer ,
1882
1882
item : & clean:: Item ,
1883
+ cx : & Context ,
1883
1884
link : AssocItemLink < ' _ > ,
1884
1885
prefix : & str ,
1885
1886
is_hidden : bool ,
1887
+ parent : Option < & clean:: Item > ,
1888
+ show_def_docs : bool ,
1886
1889
) {
1890
+ document_item_info ( w, cx, item, is_hidden, parent) ;
1891
+ if !show_def_docs {
1892
+ return ;
1893
+ }
1887
1894
if let Some ( s) = item. doc_value ( ) {
1888
1895
let mut summary_html = MarkdownSummaryLine ( s, & item. links ( ) ) . into_string ( ) ;
1889
1896
@@ -3806,13 +3813,22 @@ fn render_impl(
3806
3813
if let Some ( it) = t. items . iter ( ) . find ( |i| i. name == item. name ) {
3807
3814
// We need the stability of the item from the trait
3808
3815
// because impls can't have a stability.
3809
- document_item_info ( w, cx, it, is_hidden, Some ( parent) ) ;
3810
3816
if item. doc_value ( ) . is_some ( ) {
3817
+ document_item_info ( w, cx, it, is_hidden, Some ( parent) ) ;
3811
3818
document_full ( w, item, cx, "" , is_hidden) ;
3812
- } else if show_def_docs {
3819
+ } else {
3813
3820
// In case the item isn't documented,
3814
3821
// provide short documentation from the trait.
3815
- document_short ( w, it, link, "" , is_hidden) ;
3822
+ document_short (
3823
+ w,
3824
+ it,
3825
+ cx,
3826
+ link,
3827
+ "" ,
3828
+ is_hidden,
3829
+ Some ( parent) ,
3830
+ show_def_docs,
3831
+ ) ;
3816
3832
}
3817
3833
}
3818
3834
} else {
@@ -3822,10 +3838,7 @@ fn render_impl(
3822
3838
}
3823
3839
}
3824
3840
} else {
3825
- document_item_info ( w, cx, item, is_hidden, Some ( parent) ) ;
3826
- if show_def_docs {
3827
- document_short ( w, item, link, "" , is_hidden) ;
3828
- }
3841
+ document_short ( w, item, cx, link, "" , is_hidden, Some ( parent) , show_def_docs) ;
3829
3842
}
3830
3843
}
3831
3844
}
0 commit comments