@@ -2229,12 +2229,15 @@ fn stability_tags(item: &clean::Item) -> String {
2229
2229
tags += & tag_html ( "deprecated" , message) ;
2230
2230
}
2231
2231
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" ) ;
2238
2241
}
2239
2242
2240
2243
if let Some ( ref cfg) = item. attrs . cfg {
@@ -2285,15 +2288,13 @@ fn short_stability(item: &clean::Item, cx: &Context) -> Vec<String> {
2285
2288
) ) ;
2286
2289
}
2287
2290
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 ( ) ;
2297
2298
2298
2299
if let Some ( feature) = stab. feature . as_deref ( ) {
2299
2300
let mut feature = format ! ( "<code>{}</code>" , Escape ( & feature) ) ;
@@ -2309,17 +2310,6 @@ fn short_stability(item: &clean::Item, cx: &Context) -> Vec<String> {
2309
2310
}
2310
2311
2311
2312
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
-
2323
2313
let mut ids = cx. id_map . borrow_mut ( ) ;
2324
2314
message = format ! (
2325
2315
"<details><summary>{}</summary>{}</details>" ,
@@ -2335,8 +2325,7 @@ fn short_stability(item: &clean::Item, cx: &Context) -> Vec<String> {
2335
2325
) ;
2336
2326
}
2337
2327
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) ) ;
2340
2329
}
2341
2330
2342
2331
if let Some ( ref cfg) = item. attrs . cfg {
0 commit comments