@@ -3136,23 +3136,20 @@ fn item_trait(
31363136 // FIXME: we should be using a derived_id for the Anchors here
31373137 write ! ( w, "{{\n " ) ?;
31383138 for t in & types {
3139- write ! ( w, " " ) ?;
31403139 render_assoc_item ( w, t, AssocItemLink :: Anchor ( None ) , ItemType :: Trait ) ?;
31413140 write ! ( w, ";\n " ) ?;
31423141 }
31433142 if !types. is_empty ( ) && !consts. is_empty ( ) {
31443143 w. write_str ( "\n " ) ?;
31453144 }
31463145 for t in & consts {
3147- write ! ( w, " " ) ?;
31483146 render_assoc_item ( w, t, AssocItemLink :: Anchor ( None ) , ItemType :: Trait ) ?;
31493147 write ! ( w, ";\n " ) ?;
31503148 }
31513149 if !consts. is_empty ( ) && !required. is_empty ( ) {
31523150 w. write_str ( "\n " ) ?;
31533151 }
31543152 for ( pos, m) in required. iter ( ) . enumerate ( ) {
3155- write ! ( w, " " ) ?;
31563153 render_assoc_item ( w, m, AssocItemLink :: Anchor ( None ) , ItemType :: Trait ) ?;
31573154 write ! ( w, ";\n " ) ?;
31583155
@@ -3164,7 +3161,6 @@ fn item_trait(
31643161 w. write_str ( "\n " ) ?;
31653162 }
31663163 for ( pos, m) in provided. iter ( ) . enumerate ( ) {
3167- write ! ( w, " " ) ?;
31683164 render_assoc_item ( w, m, AssocItemLink :: Anchor ( None ) , ItemType :: Trait ) ?;
31693165 match m. inner {
31703166 clean:: MethodItem ( ref inner) if !inner. generics . where_predicates . is_empty ( ) => {
@@ -3473,8 +3469,9 @@ fn render_assoc_item(w: &mut fmt::Formatter<'_>,
34733469 ( 0 , true )
34743470 } ;
34753471 render_attributes ( w, meth) ?;
3476- write ! ( w, "{}{}{}{}{}{}fn <a href='{href}' class='fnname'>{name}</a>\
3472+ write ! ( w, "{}{}{}{}{}{}{} fn <a href='{href}' class='fnname'>{name}</a>\
34773473 {generics}{decl}{where_clause}",
3474+ if parent == ItemType :: Trait { " " } else { "" } ,
34783475 VisSpace ( & meth. visibility) ,
34793476 ConstnessSpace ( header. constness) ,
34803477 UnsafetySpace ( header. unsafety) ,
@@ -3775,7 +3772,7 @@ const ATTRIBUTE_WHITELIST: &'static [&'static str] = &[
37753772 "non_exhaustive"
37763773] ;
37773774
3778- fn render_attributes ( w : & mut fmt:: Formatter < ' _ > , it : & clean:: Item ) -> fmt:: Result {
3775+ fn render_attributes ( w : & mut dyn fmt:: Write , it : & clean:: Item ) -> fmt:: Result {
37793776 let mut attrs = String :: new ( ) ;
37803777
37813778 for attr in & it. attrs . other_attrs {
0 commit comments