@@ -2678,7 +2678,6 @@ fn item_function(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
2678
2678
2679
2679
fn render_implementor ( cx : & Context , implementor : & Impl , w : & mut fmt:: Formatter ,
2680
2680
implementor_dups : & FxHashMap < & str , ( DefId , bool ) > ) -> fmt:: Result {
2681
- write ! ( w, "<li><table class='table-display'><tbody><tr><td><code>" ) ?;
2682
2681
// If there's already another implementor that has the same abbridged name, use the
2683
2682
// full path, for example in `std::iter::ExactSizeIterator`
2684
2683
let use_absolute = match implementor. inner_impl ( ) . for_ {
@@ -2689,22 +2688,8 @@ fn render_implementor(cx: &Context, implementor: &Impl, w: &mut fmt::Formatter,
2689
2688
} => implementor_dups[ path. last_name ( ) ] . 1 ,
2690
2689
_ => false ,
2691
2690
} ;
2692
- fmt_impl_for_trait_page ( & implementor. inner_impl ( ) , w, use_absolute) ?;
2693
- for it in & implementor. inner_impl ( ) . items {
2694
- if let clean:: TypedefItem ( ref tydef, _) = it. inner {
2695
- write ! ( w, "<span class=\" where fmt-newline\" > " ) ?;
2696
- assoc_type ( w, it, & [ ] , Some ( & tydef. type_ ) , AssocItemLink :: Anchor ( None ) ) ?;
2697
- write ! ( w, ";</span>" ) ?;
2698
- }
2699
- }
2700
- write ! ( w, "</code><td>" ) ?;
2701
- if let Some ( l) = ( Item { cx, item : & implementor. impl_item } ) . src_href ( ) {
2702
- write ! ( w, "<div class='out-of-band'>" ) ?;
2703
- write ! ( w, "<a class='srclink' href='{}' title='{}'>[src]</a>" ,
2704
- l, "goto source code" ) ?;
2705
- write ! ( w, "</div>" ) ?;
2706
- }
2707
- writeln ! ( w, "</td></tr></tbody></table></li>" ) ?;
2691
+ render_impl ( w, cx, implementor, AssocItemLink :: Anchor ( None ) , RenderMode :: Normal ,
2692
+ implementor. impl_item . stable_since ( ) , false , Some ( use_absolute) ) ?;
2708
2693
Ok ( ( ) )
2709
2694
}
2710
2695
@@ -2715,7 +2700,7 @@ fn render_impls(cx: &Context, w: &mut fmt::Formatter,
2715
2700
let did = i. trait_did ( ) . unwrap ( ) ;
2716
2701
let assoc_link = AssocItemLink :: GotoSource ( did, & i. inner_impl ( ) . provided_trait_methods ) ;
2717
2702
render_impl ( w, cx, i, assoc_link,
2718
- RenderMode :: Normal , containing_item. stable_since ( ) , true ) ?;
2703
+ RenderMode :: Normal , containing_item. stable_since ( ) , true , None ) ?;
2719
2704
}
2720
2705
Ok ( ( ) )
2721
2706
}
@@ -2907,14 +2892,14 @@ fn item_trait(
2907
2892
<h2 id='implementors' class='small-section-header'>\
2908
2893
Implementors<a href='#implementors' class='anchor'></a>\
2909
2894
</h2>\
2910
- <ul class='item-list' id='implementors-list'>\
2895
+ <div class='item-list' id='implementors-list'>\
2911
2896
";
2912
2897
2913
2898
let synthetic_impl_header = "\
2914
2899
<h2 id='synthetic-implementors' class='small-section-header'>\
2915
2900
Auto implementors<a href='#synthetic-implementors' class='anchor'></a>\
2916
2901
</h2>\
2917
- <ul class='item-list' id='synthetic-implementors-list'>\
2902
+ <div class='item-list' id='synthetic-implementors-list'>\
2918
2903
";
2919
2904
2920
2905
let mut synthetic_types = Vec :: new ( ) ;
@@ -2964,7 +2949,8 @@ fn item_trait(
2964
2949
& implementor. inner_impl ( ) . provided_trait_methods
2965
2950
) ;
2966
2951
render_impl ( w, cx, & implementor, assoc_link,
2967
- RenderMode :: Normal , implementor. impl_item . stable_since ( ) , false ) ?;
2952
+ RenderMode :: Normal , implementor. impl_item . stable_since ( ) , false ,
2953
+ None ) ?;
2968
2954
}
2969
2955
}
2970
2956
}
@@ -2973,7 +2959,7 @@ fn item_trait(
2973
2959
for implementor in concrete {
2974
2960
render_implementor ( cx, implementor, w, & implementor_dups) ?;
2975
2961
}
2976
- write ! ( w, "</ul >" ) ?;
2962
+ write ! ( w, "</div >" ) ?;
2977
2963
2978
2964
if t. auto {
2979
2965
write ! ( w, "{}" , synthetic_impl_header) ?;
@@ -2983,17 +2969,17 @@ fn item_trait(
2983
2969
) ;
2984
2970
render_implementor ( cx, implementor, w, & implementor_dups) ?;
2985
2971
}
2986
- write ! ( w, "</ul >" ) ?;
2972
+ write ! ( w, "</div >" ) ?;
2987
2973
}
2988
2974
} else {
2989
2975
// even without any implementations to write in, we still want the heading and list, so the
2990
2976
// implementors javascript file pulled in below has somewhere to write the impls into
2991
2977
write ! ( w, "{}" , impl_header) ?;
2992
- write ! ( w, "</ul >" ) ?;
2978
+ write ! ( w, "</div >" ) ?;
2993
2979
2994
2980
if t. auto {
2995
2981
write ! ( w, "{}" , synthetic_impl_header) ?;
2996
- write ! ( w, "</ul >" ) ?;
2982
+ write ! ( w, "</div >" ) ?;
2997
2983
}
2998
2984
}
2999
2985
write ! ( w, r#"<script type="text/javascript">window.inlined_types=new Set({});</script>"# ,
@@ -3616,7 +3602,7 @@ fn render_assoc_items(w: &mut fmt::Formatter,
3616
3602
} ;
3617
3603
for i in & non_trait {
3618
3604
render_impl ( w, cx, i, AssocItemLink :: Anchor ( None ) , render_mode,
3619
- containing_item. stable_since ( ) , true ) ?;
3605
+ containing_item. stable_since ( ) , true , None ) ?;
3620
3606
}
3621
3607
}
3622
3608
if let AssocItemRender :: DerefFor { .. } = what {
@@ -3797,15 +3783,32 @@ fn spotlight_decl(decl: &clean::FnDecl) -> Result<String, fmt::Error> {
3797
3783
3798
3784
fn render_impl ( w : & mut fmt:: Formatter , cx : & Context , i : & Impl , link : AssocItemLink ,
3799
3785
render_mode : RenderMode , outer_version : Option < & str > ,
3800
- show_def_docs : bool ) -> fmt:: Result {
3786
+ show_def_docs : bool , use_absolute : Option < bool > ) -> fmt:: Result {
3801
3787
if render_mode == RenderMode :: Normal {
3802
3788
let id = cx. derive_id ( match i. inner_impl ( ) . trait_ {
3803
3789
Some ( ref t) => format ! ( "impl-{}" , small_url_encode( & format!( "{:#}" , t) ) ) ,
3804
3790
None => "impl" . to_string ( ) ,
3805
3791
} ) ;
3806
- write ! ( w, "<h3 id='{}' class='impl'><span class='in-band'><table class='table-display'>\
3807
- <tbody><tr><td><code>{}</code>",
3808
- id, i. inner_impl( ) ) ?;
3792
+ if let Some ( use_absolute) = use_absolute {
3793
+ write ! ( w, "<h3 id='{}' class='impl'><span class='in-band'><table class='table-display'>\
3794
+ <tbody><tr><td><code>", id) ?;
3795
+ fmt_impl_for_trait_page ( & i. inner_impl ( ) , w, use_absolute) ?;
3796
+ if show_def_docs {
3797
+ for it in & i. inner_impl ( ) . items {
3798
+ if let clean:: TypedefItem ( ref tydef, _) = it. inner {
3799
+ write ! ( w, "<span class=\" where fmt-newline\" > " ) ?;
3800
+ assoc_type ( w, it, & vec ! [ ] , Some ( & tydef. type_ ) ,
3801
+ AssocItemLink :: Anchor ( None ) ) ?;
3802
+ write ! ( w, ";</span>" ) ?;
3803
+ }
3804
+ }
3805
+ }
3806
+ write ! ( w, "</code>" ) ?;
3807
+ } else {
3808
+ write ! ( w, "<h3 id='{}' class='impl'><span class='in-band'><table class='table-display'>\
3809
+ <tbody><tr><td><code>{}</code>",
3810
+ id, i. inner_impl( ) ) ?;
3811
+ }
3809
3812
write ! ( w, "<a href='#{}' class='anchor'></a>" , id) ?;
3810
3813
write ! ( w, "</span></td><td><span class='out-of-band'>" ) ?;
3811
3814
let since = i. impl_item . stability . as_ref ( ) . map ( |s| & s. since [ ..] ) ;
@@ -3929,10 +3932,6 @@ fn render_impl(w: &mut fmt::Formatter, cx: &Context, i: &Impl, link: AssocItemLi
3929
3932
let traits = & cache ( ) . traits ;
3930
3933
let trait_ = i. trait_did ( ) . map ( |did| & traits[ & did] ) ;
3931
3934
3932
- if !show_def_docs {
3933
- write ! ( w, "<span class='docblock autohide'>" ) ?;
3934
- }
3935
-
3936
3935
write ! ( w, "<div class='impl-items'>" ) ?;
3937
3936
for trait_item in & i. inner_impl ( ) . items {
3938
3937
doc_impl_item ( w, cx, trait_item, link, render_mode,
@@ -3968,10 +3967,6 @@ fn render_impl(w: &mut fmt::Formatter, cx: &Context, i: &Impl, link: AssocItemLi
3968
3967
}
3969
3968
write ! ( w, "</div>" ) ?;
3970
3969
3971
- if !show_def_docs {
3972
- write ! ( w, "</span>" ) ?;
3973
- }
3974
-
3975
3970
Ok ( ( ) )
3976
3971
}
3977
3972
0 commit comments