@@ -1871,8 +1871,10 @@ fn short_stability(item: &clean::Item, cx: &Context, show_reason: bool) -> Vec<S
18711871 } ;
18721872
18731873 if stab. level == stability:: Unstable {
1874- let unstable_extra = if show_reason {
1875- match ( !stab. feature . is_empty ( ) , & cx. shared . issue_tracker_base_url , stab. issue ) {
1874+ if show_reason {
1875+ let unstable_extra = match ( !stab. feature . is_empty ( ) ,
1876+ & cx. shared . issue_tracker_base_url ,
1877+ stab. issue ) {
18761878 ( true , & Some ( ref tracker_url) , Some ( issue_no) ) if issue_no > 0 =>
18771879 format ! ( " (<code>{}</code> <a href=\" {}{}\" >#{}</a>)" ,
18781880 Escape ( & stab. feature) , tracker_url, issue_no, issue_no) ,
@@ -1882,17 +1884,22 @@ fn short_stability(item: &clean::Item, cx: &Context, show_reason: bool) -> Vec<S
18821884 ( true , ..) =>
18831885 format ! ( " (<code>{}</code>)" , Escape ( & stab. feature) ) ,
18841886 _ => String :: new ( ) ,
1887+ } ;
1888+ if stab. unstable_reason . is_empty ( ) {
1889+ stability. push ( format ! ( "<div class='stab unstable'>\
1890+ <span class=microscope>🔬</span> \
1891+ This is a nightly-only experimental API. {}</div>",
1892+ unstable_extra) ) ;
1893+ } else {
1894+ let text = format ! ( "<summary><span class=microscope>🔬</span> \
1895+ This is a nightly-only experimental API. {}</summary>{}",
1896+ unstable_extra, MarkdownHtml ( & stab. unstable_reason) ) ;
1897+ stability. push ( format ! ( "<div class='stab unstable'><details>{}</details></div>" ,
1898+ text) ) ;
18851899 }
18861900 } else {
1887- String :: new ( )
1888- } ;
1889- let unstable_reason = if show_reason && !stab. unstable_reason . is_empty ( ) {
1890- format ! ( ": {}" , stab. unstable_reason)
1891- } else {
1892- String :: new ( )
1893- } ;
1894- let text = format ! ( "Unstable{}{}" , unstable_extra, MarkdownHtml ( & unstable_reason) ) ;
1895- stability. push ( format ! ( "<div class='stab unstable'>{}</div>" , text) )
1901+ stability. push ( format ! ( "<div class='stab unstable'>Experimental</div>" ) )
1902+ }
18961903 } ;
18971904 } else if let Some ( depr) = item. deprecation . as_ref ( ) {
18981905 let note = if show_reason && !depr. note . is_empty ( ) {
0 commit comments