@@ -1816,8 +1816,7 @@ fn plain_summary_line(s: Option<&str>) -> String {
18161816
18171817fn document ( w : & mut fmt:: Formatter , cx : & Context , item : & clean:: Item ) -> fmt:: Result {
18181818 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) ;
18211820 document_full ( w, item, cx, & prefix) ?;
18221821 Ok ( ( ) )
18231822}
@@ -2267,10 +2266,15 @@ fn item_function(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
22672266 AbiSpace ( f. abi) ,
22682267 it. name. as_ref( ) . unwrap( ) ,
22692268 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+ } ;
22702274 write ! ( w, "<pre class='rust fn'>" ) ?;
22712275 render_attributes ( w, it) ?;
22722276 write ! ( w, "{vis}{constness}{unsafety}{abi}fn \
2273- {name}{generics}{decl}{where_clause}</pre>",
2277+ {name}{generics}{decl}{where_clause}</pre>{extra} ",
22742278 vis = VisSpace ( & it. visibility) ,
22752279 constness = ConstnessSpace ( f. constness) ,
22762280 unsafety = UnsafetySpace ( f. unsafety) ,
@@ -2282,7 +2286,8 @@ fn item_function(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
22822286 decl: & f. decl,
22832287 name_len,
22842288 indent: 0 ,
2285- } ) ?;
2289+ } ,
2290+ extra = extra) ?;
22862291 document ( w, cx, it)
22872292}
22882293
@@ -3266,7 +3271,7 @@ fn spotlight_decl(decl: &clean::FnDecl) -> Result<String, fmt::Error> {
32663271 if out. is_empty ( ) {
32673272 out. push_str ( "<span class=\" docblock autohide\" >" ) ;
32683273 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 \" >" ) ;
32703275 }
32713276
32723277 //use the "where" class here to make it small
@@ -3287,7 +3292,8 @@ fn spotlight_decl(decl: &clean::FnDecl) -> Result<String, fmt::Error> {
32873292 }
32883293
32893294 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>" ) ;
32913297 }
32923298
32933299 Ok ( out)
@@ -3327,7 +3333,6 @@ fn render_impl(w: &mut fmt::Formatter, cx: &Context, i: &Impl, link: AssocItemLi
33273333 trait_ : Option < & clean:: Trait > , show_def_docs : bool ) -> fmt:: Result {
33283334 let item_type = item. type_ ( ) ;
33293335 let name = item. name . as_ref ( ) . unwrap ( ) ;
3330- let mut method_prefix: Option < String > = None ;
33313336
33323337 let render_method_item: bool = match render_mode {
33333338 RenderMode :: Normal => true ,
@@ -3342,6 +3347,7 @@ fn render_impl(w: &mut fmt::Formatter, cx: &Context, i: &Impl, link: AssocItemLi
33423347 let id = derive_id ( format ! ( "{}.{}" , item_type, name) ) ;
33433348 let ns_id = derive_id ( format ! ( "{}.{}" , name, item_type. name_space( ) ) ) ;
33443349 write ! ( w, "<h4 id='{}' class=\" {}\" >" , id, item_type) ?;
3350+ write ! ( w, "{}" , spotlight_decl( decl) ?) ?;
33453351 write ! ( w, "<span id='{}' class='invisible'>" , ns_id) ?;
33463352 write ! ( w, "<code>" ) ?;
33473353 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
33563362 render_stability_since_raw ( w, item. stable_since ( ) , outer_version) ?;
33573363 }
33583364 write ! ( w, "</span></h4>\n " ) ?;
3359- method_prefix = Some ( spotlight_decl ( decl) ?) ;
33603365 }
33613366 }
33623367 clean:: TypedefItem ( ref tydef, _) => {
@@ -3388,11 +3393,7 @@ fn render_impl(w: &mut fmt::Formatter, cx: &Context, i: &Impl, link: AssocItemLi
33883393 }
33893394
33903395 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) ;
33963397
33973398 if !is_default_item {
33983399 if let Some ( t) = trait_ {
0 commit comments