@@ -177,7 +177,7 @@ pub enum ExternalLocation {
177177}
178178
179179/// Metadata about implementations for a type or trait.
180- #[ derive( Clone ) ]
180+ #[ derive( Clone , Debug ) ]
181181pub struct Impl {
182182 pub impl_item : clean:: Item ,
183183}
@@ -2900,18 +2900,18 @@ fn item_trait(
29002900 render_assoc_items ( w, cx, it, it. def_id , AssocItemRender :: All ) ?;
29012901
29022902 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'>\
29082908 ";
29092909
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'>\
29152915 ";
29162916
29172917 let mut synthetic_types = Vec :: new ( ) ;
@@ -2942,9 +2942,9 @@ fn item_trait(
29422942 . map_or ( true , |d| cache. paths . contains_key ( & d) ) ) ;
29432943
29442944
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 ) ;
29482948
29492949 if !foreign. is_empty ( ) {
29502950 write ! ( w, "
@@ -3626,9 +3626,12 @@ fn render_assoc_items(w: &mut fmt::Formatter,
36263626 render_deref_methods ( w, cx, impl_, containing_item, has_deref_mut) ?;
36273627 }
36283628
3629- let ( synthetic, concrete) = traits
3629+ let ( synthetic, concrete) : ( Vec < & & Impl > , Vec < & & Impl > ) = traits
36303630 . 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 ( ) ) ;
36323635
36333636 struct RendererStruct < ' a , ' b , ' c > ( & ' a Context , Vec < & ' b & ' b Impl > , & ' c clean:: Item ) ;
36343637
@@ -3658,6 +3661,18 @@ fn render_assoc_items(w: &mut fmt::Formatter,
36583661 render_impls ( cx, w, & synthetic, containing_item) ?;
36593662 write ! ( w, "</div>" ) ?;
36603663 }
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+ }
36613676 }
36623677 Ok ( ( ) )
36633678}
@@ -4203,12 +4218,16 @@ fn sidebar_assoc_items(it: &clean::Item) -> String {
42034218 . collect :: < String > ( )
42044219 } ;
42054220
4206- let ( synthetic, concrete) = v
4221+ let ( synthetic, concrete) : ( Vec < & Impl > , Vec < & Impl > ) = v
42074222 . iter ( )
42084223 . 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 ( ) ) ;
42094227
42104228 let concrete_format = format_impls ( concrete) ;
42114229 let synthetic_format = format_impls ( synthetic) ;
4230+ let blanket_format = format_impls ( blanket_impl) ;
42124231
42134232 if !concrete_format. is_empty ( ) {
42144233 out. push_str ( "<a class=\" sidebar-title\" href=\" #implementations\" >\
@@ -4221,6 +4240,12 @@ fn sidebar_assoc_items(it: &clean::Item) -> String {
42214240 Auto Trait Implementations</a>") ;
42224241 out. push_str ( & format ! ( "<div class=\" sidebar-links\" >{}</div>" , synthetic_format) ) ;
42234242 }
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+ }
42244249 }
42254250 }
42264251
0 commit comments