@@ -3389,8 +3389,10 @@ fn assoc_const(w: &mut fmt::Formatter<'_>,
3389
3389
it : & clean:: Item ,
3390
3390
ty : & clean:: Type ,
3391
3391
_default : Option < & String > ,
3392
- link : AssocItemLink < ' _ > ) -> fmt:: Result {
3393
- write ! ( w, "{}const <a href='{}' class=\" constant\" ><b>{}</b></a>: {}" ,
3392
+ link : AssocItemLink < ' _ > ,
3393
+ extra : & str ) -> fmt:: Result {
3394
+ write ! ( w, "{}{}const <a href='{}' class=\" constant\" ><b>{}</b></a>: {}" ,
3395
+ extra,
3394
3396
VisSpace ( & it. visibility) ,
3395
3397
naive_assoc_href( it, link) ,
3396
3398
it. name. as_ref( ) . unwrap( ) ,
@@ -3401,8 +3403,10 @@ fn assoc_const(w: &mut fmt::Formatter<'_>,
3401
3403
fn assoc_type < W : fmt:: Write > ( w : & mut W , it : & clean:: Item ,
3402
3404
bounds : & [ clean:: GenericBound ] ,
3403
3405
default : Option < & clean:: Type > ,
3404
- link : AssocItemLink < ' _ > ) -> fmt:: Result {
3405
- write ! ( w, "type <a href='{}' class=\" type\" >{}</a>" ,
3406
+ link : AssocItemLink < ' _ > ,
3407
+ extra : & str ) -> fmt:: Result {
3408
+ write ! ( w, "{}type <a href='{}' class=\" type\" >{}</a>" ,
3409
+ extra,
3406
3410
naive_assoc_href( it, link) ,
3407
3411
it. name. as_ref( ) . unwrap( ) ) ?;
3408
3412
if !bounds. is_empty ( ) {
@@ -3513,10 +3517,12 @@ fn render_assoc_item(w: &mut fmt::Formatter<'_>,
3513
3517
method ( w, item, m. header , & m. generics , & m. decl , link, parent)
3514
3518
}
3515
3519
clean:: AssociatedConstItem ( ref ty, ref default) => {
3516
- assoc_const ( w, item, ty, default. as_ref ( ) , link)
3520
+ assoc_const ( w, item, ty, default. as_ref ( ) , link,
3521
+ if parent == ItemType :: Trait { " " } else { "" } )
3517
3522
}
3518
3523
clean:: AssociatedTypeItem ( ref bounds, ref default) => {
3519
- assoc_type ( w, item, bounds, default. as_ref ( ) , link)
3524
+ assoc_type ( w, item, bounds, default. as_ref ( ) , link,
3525
+ if parent == ItemType :: Trait { " " } else { "" } )
3520
3526
}
3521
3527
_ => panic ! ( "render_assoc_item called on non-associated-item" )
3522
3528
}
@@ -4129,7 +4135,8 @@ fn spotlight_decl(decl: &clean::FnDecl) -> Result<String, fmt::Error> {
4129
4135
out. push_str ( "<span class=\" where fmt-newline\" > " ) ;
4130
4136
assoc_type ( & mut out, it, & [ ] ,
4131
4137
Some ( & tydef. type_ ) ,
4132
- AssocItemLink :: GotoSource ( t_did, & FxHashSet :: default ( ) ) ) ?;
4138
+ AssocItemLink :: GotoSource ( t_did, & FxHashSet :: default ( ) ) ,
4139
+ "" ) ?;
4133
4140
out. push_str ( ";</span>" ) ;
4134
4141
}
4135
4142
}
@@ -4165,7 +4172,8 @@ fn render_impl(w: &mut fmt::Formatter<'_>, cx: &Context, i: &Impl, link: AssocIt
4165
4172
if let clean:: TypedefItem ( ref tydef, _) = it. inner {
4166
4173
write ! ( w, "<span class=\" where fmt-newline\" > " ) ?;
4167
4174
assoc_type ( w, it, & vec ! [ ] , Some ( & tydef. type_ ) ,
4168
- AssocItemLink :: Anchor ( None ) ) ?;
4175
+ AssocItemLink :: Anchor ( None ) ,
4176
+ "" ) ?;
4169
4177
write ! ( w, ";</span>" ) ?;
4170
4178
}
4171
4179
}
@@ -4235,15 +4243,15 @@ fn render_impl(w: &mut fmt::Formatter<'_>, cx: &Context, i: &Impl, link: AssocIt
4235
4243
let ns_id = cx. derive_id ( format ! ( "{}.{}" , name, item_type. name_space( ) ) ) ;
4236
4244
write ! ( w, "<h4 id='{}' class=\" {}{}\" >" , id, item_type, extra_class) ?;
4237
4245
write ! ( w, "<code id='{}'>" , ns_id) ?;
4238
- assoc_type ( w, item, & Vec :: new ( ) , Some ( & tydef. type_ ) , link. anchor ( & id) ) ?;
4246
+ assoc_type ( w, item, & Vec :: new ( ) , Some ( & tydef. type_ ) , link. anchor ( & id) , "" ) ?;
4239
4247
write ! ( w, "</code></h4>" ) ?;
4240
4248
}
4241
4249
clean:: AssociatedConstItem ( ref ty, ref default) => {
4242
4250
let id = cx. derive_id ( format ! ( "{}.{}" , item_type, name) ) ;
4243
4251
let ns_id = cx. derive_id ( format ! ( "{}.{}" , name, item_type. name_space( ) ) ) ;
4244
4252
write ! ( w, "<h4 id='{}' class=\" {}{}\" >" , id, item_type, extra_class) ?;
4245
4253
write ! ( w, "<code id='{}'>" , ns_id) ?;
4246
- assoc_const ( w, item, ty, default. as_ref ( ) , link. anchor ( & id) ) ?;
4254
+ assoc_const ( w, item, ty, default. as_ref ( ) , link. anchor ( & id) , "" ) ?;
4247
4255
write ! ( w, "</code>" ) ?;
4248
4256
render_stability_since_raw ( w, item. stable_since ( ) , outer_version) ?;
4249
4257
if let Some ( l) = ( Item { cx, item } ) . src_href ( ) {
@@ -4257,7 +4265,7 @@ fn render_impl(w: &mut fmt::Formatter<'_>, cx: &Context, i: &Impl, link: AssocIt
4257
4265
let ns_id = cx. derive_id ( format ! ( "{}.{}" , name, item_type. name_space( ) ) ) ;
4258
4266
write ! ( w, "<h4 id='{}' class=\" {}{}\" >" , id, item_type, extra_class) ?;
4259
4267
write ! ( w, "<code id='{}'>" , ns_id) ?;
4260
- assoc_type ( w, item, bounds, default. as_ref ( ) , link. anchor ( & id) ) ?;
4268
+ assoc_type ( w, item, bounds, default. as_ref ( ) , link. anchor ( & id) , "" ) ?;
4261
4269
write ! ( w, "</code></h4>" ) ?;
4262
4270
}
4263
4271
clean:: StrippedItem ( ..) => return Ok ( ( ) ) ,
0 commit comments