@@ -2282,12 +2282,23 @@ fn render_implementor(cx: &Context, implementor: &Impl, w: &mut Buffer,
2282
2282
fn render_impls ( cx : & Context , w : & mut Buffer ,
2283
2283
traits : & [ & & Impl ] ,
2284
2284
containing_item : & clean:: Item ) {
2285
- for i in traits {
2286
- let did = i. trait_did ( ) . unwrap ( ) ;
2287
- let assoc_link = AssocItemLink :: GotoSource ( did, & i. inner_impl ( ) . provided_trait_methods ) ;
2288
- render_impl ( w, cx, i, assoc_link,
2289
- RenderMode :: Normal , containing_item. stable_since ( ) , true , None , false , true ) ;
2290
- }
2285
+ let mut impls = traits. iter ( )
2286
+ . map ( |i| {
2287
+ let did = i. trait_did ( ) . unwrap ( ) ;
2288
+ let assoc_link = AssocItemLink :: GotoSource ( did, & i. inner_impl ( ) . provided_trait_methods ) ;
2289
+ let mut buffer = if w. is_for_html ( ) {
2290
+ Buffer :: html ( )
2291
+ } else {
2292
+ Buffer :: new ( )
2293
+ } ;
2294
+ render_impl ( & mut buffer, cx, i, assoc_link,
2295
+ RenderMode :: Normal , containing_item. stable_since ( ) ,
2296
+ true , None , false , true ) ;
2297
+ buffer. into_inner ( )
2298
+ } )
2299
+ . collect :: < Vec < _ > > ( ) ;
2300
+ impls. sort ( ) ;
2301
+ w. write_str ( & impls. join ( "" ) ) ;
2291
2302
}
2292
2303
2293
2304
fn bounds ( t_bounds : & [ clean:: GenericBound ] , trait_alias : bool ) -> String {
0 commit comments