File tree Expand file tree Collapse file tree 1 file changed +19
-5
lines changed Expand file tree Collapse file tree 1 file changed +19
-5
lines changed Original file line number Diff line number Diff line change @@ -4063,11 +4063,25 @@ fn get_methods(
4063
4063
. filter_map ( |item| match item. name {
4064
4064
Some ( ref name) if !name. is_empty ( ) && item. is_method ( ) => {
4065
4065
if !for_deref || should_render_item ( item, deref_mut) {
4066
- Some ( format ! (
4067
- "<a href=\" #{}\" >{}</a>" ,
4068
- get_next_url( used_links, format!( "method.{}" , name) ) ,
4069
- name
4070
- ) )
4066
+ let mut emojis = String :: new ( ) ;
4067
+ if let clean:: FunctionItem ( ref func) | clean:: ForeignFunctionItem ( ref func) = item. inner {
4068
+ if func. header . unsafety == hir:: Unsafety :: Unsafe {
4069
+ emojis += "⚠" ;
4070
+ }
4071
+ }
4072
+ if let Some ( stab) = item. stability . as_ref ( ) . filter ( |stab| stab. level == stability:: Unstable ) {
4073
+ let is_rustc_private = stab. feature . as_ref ( ) . map ( |s| & * * s) == Some ( "rustc_private" ) ;
4074
+ emojis += if is_rustc_private { "⚙️" } else { "🔬" } ;
4075
+ } ;
4076
+ if item. deprecation ( ) . is_some ( ) {
4077
+ emojis += "⚰️" ;
4078
+ }
4079
+ if !emojis. is_empty ( ) {
4080
+ emojis. insert_str ( 0 , "<sup>" ) ;
4081
+ emojis. push_str ( "</sup>" ) ;
4082
+ }
4083
+ let url = get_next_url ( used_links, format ! ( "method.{}" , name) ) ;
4084
+ Some ( format ! ( "<a href=\" #{}\" >{}{}</a>" , url, name, emojis) )
4071
4085
} else {
4072
4086
None
4073
4087
}
You can’t perform that action at this time.
0 commit comments