@@ -177,7 +177,7 @@ pub enum ExternalLocation {
177
177
}
178
178
179
179
/// Metadata about implementations for a type or trait.
180
- #[ derive( Clone ) ]
180
+ #[ derive( Clone , Debug ) ]
181
181
pub struct Impl {
182
182
pub impl_item : clean:: Item ,
183
183
}
@@ -2900,18 +2900,18 @@ fn item_trait(
2900
2900
render_assoc_items ( w, cx, it, it. def_id , AssocItemRender :: All ) ?;
2901
2901
2902
2902
let cache = cache ( ) ;
2903
- let impl_header = "
2904
- <h2 id='implementors' class='small-section-header'>
2905
- Implementors<a href='#implementors' class='anchor'></a>
2906
- </h2>
2907
- <ul class='item-list' id='implementors-list'>
2903
+ let impl_header = "\
2904
+ <h2 id='implementors' class='small-section-header'>\
2905
+ Implementors<a href='#implementors' class='anchor'></a>\
2906
+ </h2>\
2907
+ <ul class='item-list' id='implementors-list'>\
2908
2908
";
2909
2909
2910
- let synthetic_impl_header = "
2911
- <h2 id='synthetic-implementors' class='small-section-header'>
2912
- Auto implementors<a href='#synthetic-implementors' class='anchor'></a>
2913
- </h2>
2914
- <ul class='item-list' id='synthetic-implementors-list'>
2910
+ let synthetic_impl_header = "\
2911
+ <h2 id='synthetic-implementors' class='small-section-header'>\
2912
+ Auto implementors<a href='#synthetic-implementors' class='anchor'></a>\
2913
+ </h2>\
2914
+ <ul class='item-list' id='synthetic-implementors-list'>\
2915
2915
";
2916
2916
2917
2917
let mut synthetic_types = Vec :: new ( ) ;
@@ -2942,9 +2942,9 @@ fn item_trait(
2942
2942
. map_or ( true , |d| cache. paths . contains_key ( & d) ) ) ;
2943
2943
2944
2944
2945
- let ( synthetic, concrete) = local. iter ( )
2946
- . partition :: < Vec < _ > , _ > ( |i| i. inner_impl ( ) . synthetic ) ;
2947
-
2945
+ let ( synthetic, concrete) : ( Vec < & & Impl > , Vec < & & Impl > ) = local. iter ( )
2946
+ . filter ( |i| i. inner_impl ( ) . blanket_impl . is_none ( ) )
2947
+ . partition ( |i| i . inner_impl ( ) . synthetic ) ;
2948
2948
2949
2949
if !foreign. is_empty ( ) {
2950
2950
write ! ( w, "
@@ -3626,9 +3626,12 @@ fn render_assoc_items(w: &mut fmt::Formatter,
3626
3626
render_deref_methods ( w, cx, impl_, containing_item, has_deref_mut) ?;
3627
3627
}
3628
3628
3629
- let ( synthetic, concrete) = traits
3629
+ let ( synthetic, concrete) : ( Vec < & & Impl > , Vec < & & Impl > ) = traits
3630
3630
. iter ( )
3631
- . partition :: < Vec < _ > , _ > ( |t| t. inner_impl ( ) . synthetic ) ;
3631
+ . partition ( |t| t. inner_impl ( ) . synthetic ) ;
3632
+ let ( blanket_impl, concrete) = concrete
3633
+ . into_iter ( )
3634
+ . partition ( |t| t. inner_impl ( ) . blanket_impl . is_some ( ) ) ;
3632
3635
3633
3636
struct RendererStruct < ' a , ' b , ' c > ( & ' a Context , Vec < & ' b & ' b Impl > , & ' c clean:: Item ) ;
3634
3637
@@ -3658,6 +3661,18 @@ fn render_assoc_items(w: &mut fmt::Formatter,
3658
3661
render_impls ( cx, w, & synthetic, containing_item) ?;
3659
3662
write ! ( w, "</div>" ) ?;
3660
3663
}
3664
+
3665
+ if !blanket_impl. is_empty ( ) {
3666
+ write ! ( w, "\
3667
+ <h2 id='blanket-implementations' class='small-section-header'>\
3668
+ Blanket Implementations\
3669
+ <a href='#blanket-implementations' class='anchor'></a>\
3670
+ </h2>\
3671
+ <div id='blanket-implementations-list'>\
3672
+ ") ?;
3673
+ render_impls ( cx, w, & blanket_impl, containing_item) ?;
3674
+ write ! ( w, "</div>" ) ?;
3675
+ }
3661
3676
}
3662
3677
Ok ( ( ) )
3663
3678
}
@@ -4203,12 +4218,16 @@ fn sidebar_assoc_items(it: &clean::Item) -> String {
4203
4218
. collect :: < String > ( )
4204
4219
} ;
4205
4220
4206
- let ( synthetic, concrete) = v
4221
+ let ( synthetic, concrete) : ( Vec < & Impl > , Vec < & Impl > ) = v
4207
4222
. iter ( )
4208
4223
. partition :: < Vec < _ > , _ > ( |i| i. inner_impl ( ) . synthetic ) ;
4224
+ let ( blanket_impl, concrete) : ( Vec < & Impl > , Vec < & Impl > ) = concrete
4225
+ . into_iter ( )
4226
+ . partition :: < Vec < _ > , _ > ( |i| i. inner_impl ( ) . blanket_impl . is_some ( ) ) ;
4209
4227
4210
4228
let concrete_format = format_impls ( concrete) ;
4211
4229
let synthetic_format = format_impls ( synthetic) ;
4230
+ let blanket_format = format_impls ( blanket_impl) ;
4212
4231
4213
4232
if !concrete_format. is_empty ( ) {
4214
4233
out. push_str ( "<a class=\" sidebar-title\" href=\" #implementations\" >\
@@ -4221,6 +4240,12 @@ fn sidebar_assoc_items(it: &clean::Item) -> String {
4221
4240
Auto Trait Implementations</a>") ;
4222
4241
out. push_str ( & format ! ( "<div class=\" sidebar-links\" >{}</div>" , synthetic_format) ) ;
4223
4242
}
4243
+
4244
+ if !blanket_format. is_empty ( ) {
4245
+ out. push_str ( "<a class=\" sidebar-title\" href=\" #blanket-implementations\" >\
4246
+ Blanket Implementations</a>") ;
4247
+ out. push_str ( & format ! ( "<div class=\" sidebar-links\" >{}</div>" , blanket_format) ) ;
4248
+ }
4224
4249
}
4225
4250
}
4226
4251
0 commit comments