@@ -2229,12 +2229,15 @@ fn stability_tags(item: &clean::Item) -> String {
22292229 tags += & tag_html ( "deprecated" , message) ;
22302230 }
22312231
2232- if let Some ( stab) = item. stability . as_ref ( ) . filter ( |s| s. level == stability:: Unstable ) {
2233- if stab. feature . as_deref ( ) == Some ( "rustc_private" ) {
2234- tags += & tag_html ( "internal" , "Internal" ) ;
2235- } else {
2236- tags += & tag_html ( "unstable" , "Experimental" ) ;
2237- }
2232+ // The "rustc_private" crates are permanently unstable so it makes no sense
2233+ // to render "unstable" everywhere.
2234+ if item
2235+ . stability
2236+ . as_ref ( )
2237+ . map ( |s| s. level == stability:: Unstable && s. feature . as_deref ( ) != Some ( "rustc_private" ) )
2238+ == Some ( true )
2239+ {
2240+ tags += & tag_html ( "unstable" , "Experimental" ) ;
22382241 }
22392242
22402243 if let Some ( ref cfg) = item. attrs . cfg {
@@ -2285,15 +2288,13 @@ fn short_stability(item: &clean::Item, cx: &Context) -> Vec<String> {
22852288 ) ) ;
22862289 }
22872290
2288- if let Some ( stab) = item. stability . as_ref ( ) . filter ( |stab| stab. level == stability:: Unstable ) {
2289- let is_rustc_private = stab. feature . as_deref ( ) == Some ( "rustc_private" ) ;
2290-
2291- let mut message = if is_rustc_private {
2292- "<span class='emoji'>⚙️</span> This is an internal compiler API."
2293- } else {
2294- "<span class='emoji'>🔬</span> This is a nightly-only experimental API."
2295- }
2296- . to_owned ( ) ;
2291+ // Render unstable items. But don't render "rustc_private" crates (internal compiler crates).
2292+ // Those crates are permanently unstable so it makes no sense to render "unstable" everywhere.
2293+ if let Some ( stab) = item. stability . as_ref ( ) . filter ( |stab| {
2294+ stab. level == stability:: Unstable && stab. feature . as_deref ( ) != Some ( "rustc_private" )
2295+ } ) {
2296+ let mut message =
2297+ "<span class='emoji'>🔬</span> This is a nightly-only experimental API." . to_owned ( ) ;
22972298
22982299 if let Some ( feature) = stab. feature . as_deref ( ) {
22992300 let mut feature = format ! ( "<code>{}</code>" , Escape ( & feature) ) ;
@@ -2309,17 +2310,6 @@ fn short_stability(item: &clean::Item, cx: &Context) -> Vec<String> {
23092310 }
23102311
23112312 if let Some ( unstable_reason) = & stab. unstable_reason {
2312- // Provide a more informative message than the compiler help.
2313- let unstable_reason = if is_rustc_private {
2314- "This crate is being loaded from the sysroot, a permanently unstable location \
2315- for private compiler dependencies. It is not intended for general use. Prefer \
2316- using a public version of this crate from \
2317- [crates.io](https://crates.io) via [`Cargo.toml`]\
2318- (https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html)."
2319- } else {
2320- unstable_reason
2321- } ;
2322-
23232313 let mut ids = cx. id_map . borrow_mut ( ) ;
23242314 message = format ! (
23252315 "<details><summary>{}</summary>{}</details>" ,
@@ -2335,8 +2325,7 @@ fn short_stability(item: &clean::Item, cx: &Context) -> Vec<String> {
23352325 ) ;
23362326 }
23372327
2338- let class = if is_rustc_private { "internal" } else { "unstable" } ;
2339- stability. push ( format ! ( "<div class='stab {}'>{}</div>" , class, message) ) ;
2328+ stability. push ( format ! ( "<div class='stab unstable'>{}</div>" , message) ) ;
23402329 }
23412330
23422331 if let Some ( ref cfg) = item. attrs . cfg {
0 commit comments