@@ -2230,12 +2230,15 @@ fn stability_tags(item: &clean::Item) -> String {
2230
2230
tags += & tag_html ( "deprecated" , message) ;
2231
2231
}
2232
2232
2233
- if let Some ( stab) = item. stability . as_ref ( ) . filter ( |s| s. level == stability:: Unstable ) {
2234
- if stab. feature . as_deref ( ) == Some ( "rustc_private" ) {
2235
- tags += & tag_html ( "internal" , "Internal" ) ;
2236
- } else {
2237
- tags += & tag_html ( "unstable" , "Experimental" ) ;
2238
- }
2233
+ // The "rustc_private" crates are permanently unstable so it makes no sense
2234
+ // to render "unstable" everywhere.
2235
+ if item
2236
+ . stability
2237
+ . as_ref ( )
2238
+ . map ( |s| s. level == stability:: Unstable && s. feature . as_deref ( ) != Some ( "rustc_private" ) )
2239
+ == Some ( true )
2240
+ {
2241
+ tags += & tag_html ( "unstable" , "Experimental" ) ;
2239
2242
}
2240
2243
2241
2244
if let Some ( ref cfg) = item. attrs . cfg {
@@ -2286,15 +2289,13 @@ fn short_stability(item: &clean::Item, cx: &Context) -> Vec<String> {
2286
2289
) ) ;
2287
2290
}
2288
2291
2289
- if let Some ( stab) = item. stability . as_ref ( ) . filter ( |stab| stab. level == stability:: Unstable ) {
2290
- let is_rustc_private = stab. feature . as_deref ( ) == Some ( "rustc_private" ) ;
2291
-
2292
- let mut message = if is_rustc_private {
2293
- "<span class='emoji'>⚙️</span> This is an internal compiler API."
2294
- } else {
2295
- "<span class='emoji'>🔬</span> This is a nightly-only experimental API."
2296
- }
2297
- . to_owned ( ) ;
2292
+ // Render unstable items. But don't render "rustc_private" crates (internal compiler crates).
2293
+ // Those crates are permanently unstable so it makes no sense to render "unstable" everywhere.
2294
+ if let Some ( stab) = item. stability . as_ref ( ) . filter ( |stab| {
2295
+ stab. level == stability:: Unstable && stab. feature . as_deref ( ) != Some ( "rustc_private" )
2296
+ } ) {
2297
+ let mut message =
2298
+ "<span class='emoji'>🔬</span> This is a nightly-only experimental API." . to_owned ( ) ;
2298
2299
2299
2300
if let Some ( feature) = stab. feature . as_deref ( ) {
2300
2301
let mut feature = format ! ( "<code>{}</code>" , Escape ( & feature) ) ;
@@ -2310,17 +2311,6 @@ fn short_stability(item: &clean::Item, cx: &Context) -> Vec<String> {
2310
2311
}
2311
2312
2312
2313
if let Some ( unstable_reason) = & stab. unstable_reason {
2313
- // Provide a more informative message than the compiler help.
2314
- let unstable_reason = if is_rustc_private {
2315
- "This crate is being loaded from the sysroot, a permanently unstable location \
2316
- for private compiler dependencies. It is not intended for general use. Prefer \
2317
- using a public version of this crate from \
2318
- [crates.io](https://crates.io) via [`Cargo.toml`]\
2319
- (https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html)."
2320
- } else {
2321
- unstable_reason
2322
- } ;
2323
-
2324
2314
let mut ids = cx. id_map . borrow_mut ( ) ;
2325
2315
message = format ! (
2326
2316
"<details><summary>{}</summary>{}</details>" ,
@@ -2336,8 +2326,7 @@ fn short_stability(item: &clean::Item, cx: &Context) -> Vec<String> {
2336
2326
) ;
2337
2327
}
2338
2328
2339
- let class = if is_rustc_private { "internal" } else { "unstable" } ;
2340
- stability. push ( format ! ( "<div class='stab {}'>{}</div>" , class, message) ) ;
2329
+ stability. push ( format ! ( "<div class='stab unstable'>{}</div>" , message) ) ;
2341
2330
}
2342
2331
2343
2332
if let Some ( ref cfg) = item. attrs . cfg {
0 commit comments