@@ -1816,8 +1816,7 @@ fn plain_summary_line(s: Option<&str>) -> String {
1816
1816
1817
1817
fn document ( w : & mut fmt:: Formatter , cx : & Context , item : & clean:: Item ) -> fmt:: Result {
1818
1818
document_stability ( w, cx, item) ?;
1819
- let mut prefix = render_assoc_const_value ( item) ;
1820
- prefix. push_str ( & render_spotlight_traits ( item) ?) ;
1819
+ let prefix = render_assoc_const_value ( item) ;
1821
1820
document_full ( w, item, cx, & prefix) ?;
1822
1821
Ok ( ( ) )
1823
1822
}
@@ -2267,10 +2266,15 @@ fn item_function(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
2267
2266
AbiSpace ( f. abi) ,
2268
2267
it. name. as_ref( ) . unwrap( ) ,
2269
2268
f. generics) . len ( ) ;
2269
+ let mut extra = render_spotlight_traits ( it) ?;
2270
+ if !extra. is_empty ( ) {
2271
+ extra. insert_str ( 0 , "<div class=\" important-traits\" >ⓘ<div class=\" content hidden\" >" ) ;
2272
+ extra. push_str ( "</div></div>" ) ;
2273
+ } ;
2270
2274
write ! ( w, "<pre class='rust fn'>" ) ?;
2271
2275
render_attributes ( w, it) ?;
2272
2276
write ! ( w, "{vis}{constness}{unsafety}{abi}fn \
2273
- {name}{generics}{decl}{where_clause}</pre>",
2277
+ {name}{generics}{decl}{where_clause}</pre>{extra} ",
2274
2278
vis = VisSpace ( & it. visibility) ,
2275
2279
constness = ConstnessSpace ( f. constness) ,
2276
2280
unsafety = UnsafetySpace ( f. unsafety) ,
@@ -2282,7 +2286,8 @@ fn item_function(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
2282
2286
decl: & f. decl,
2283
2287
name_len,
2284
2288
indent: 0 ,
2285
- } ) ?;
2289
+ } ,
2290
+ extra = extra) ?;
2286
2291
document ( w, cx, it)
2287
2292
}
2288
2293
@@ -3266,7 +3271,7 @@ fn spotlight_decl(decl: &clean::FnDecl) -> Result<String, fmt::Error> {
3266
3271
if out. is_empty ( ) {
3267
3272
out. push_str ( "<span class=\" docblock autohide\" >" ) ;
3268
3273
out. push_str ( & format ! ( "<h3>Important traits for {}</h3>" , impl_. for_) ) ;
3269
- out. push_str ( "<code class=\" spotlight \" >" ) ;
3274
+ out. push_str ( "<code class=\" content \" >" ) ;
3270
3275
}
3271
3276
3272
3277
//use the "where" class here to make it small
@@ -3287,7 +3292,8 @@ fn spotlight_decl(decl: &clean::FnDecl) -> Result<String, fmt::Error> {
3287
3292
}
3288
3293
3289
3294
if !out. is_empty ( ) {
3290
- out. push_str ( "</code></span>" ) ;
3295
+ out. insert_str ( 0 , "<div class=\" important-traits\" >ⓘ<div class=\" content hidden\" >" ) ;
3296
+ out. push_str ( "</code></span></div></div>" ) ;
3291
3297
}
3292
3298
3293
3299
Ok ( out)
@@ -3327,7 +3333,6 @@ fn render_impl(w: &mut fmt::Formatter, cx: &Context, i: &Impl, link: AssocItemLi
3327
3333
trait_ : Option < & clean:: Trait > , show_def_docs : bool ) -> fmt:: Result {
3328
3334
let item_type = item. type_ ( ) ;
3329
3335
let name = item. name . as_ref ( ) . unwrap ( ) ;
3330
- let mut method_prefix: Option < String > = None ;
3331
3336
3332
3337
let render_method_item: bool = match render_mode {
3333
3338
RenderMode :: Normal => true ,
@@ -3342,6 +3347,7 @@ fn render_impl(w: &mut fmt::Formatter, cx: &Context, i: &Impl, link: AssocItemLi
3342
3347
let id = derive_id ( format ! ( "{}.{}" , item_type, name) ) ;
3343
3348
let ns_id = derive_id ( format ! ( "{}.{}" , name, item_type. name_space( ) ) ) ;
3344
3349
write ! ( w, "<h4 id='{}' class=\" {}\" >" , id, item_type) ?;
3350
+ write ! ( w, "{}" , spotlight_decl( decl) ?) ?;
3345
3351
write ! ( w, "<span id='{}' class='invisible'>" , ns_id) ?;
3346
3352
write ! ( w, "<code>" ) ?;
3347
3353
render_assoc_item ( w, item, link. anchor ( & id) , ItemType :: Impl ) ?;
@@ -3356,7 +3362,6 @@ fn render_impl(w: &mut fmt::Formatter, cx: &Context, i: &Impl, link: AssocItemLi
3356
3362
render_stability_since_raw ( w, item. stable_since ( ) , outer_version) ?;
3357
3363
}
3358
3364
write ! ( w, "</span></h4>\n " ) ?;
3359
- method_prefix = Some ( spotlight_decl ( decl) ?) ;
3360
3365
}
3361
3366
}
3362
3367
clean:: TypedefItem ( ref tydef, _) => {
@@ -3388,11 +3393,7 @@ fn render_impl(w: &mut fmt::Formatter, cx: &Context, i: &Impl, link: AssocItemLi
3388
3393
}
3389
3394
3390
3395
if render_method_item || render_mode == RenderMode :: Normal {
3391
- let mut prefix = render_assoc_const_value ( item) ;
3392
-
3393
- if let Some ( method_prefix) = method_prefix {
3394
- prefix. push_str ( & method_prefix) ;
3395
- }
3396
+ let prefix = render_assoc_const_value ( item) ;
3396
3397
3397
3398
if !is_default_item {
3398
3399
if let Some ( t) = trait_ {
0 commit comments