@@ -2230,12 +2230,15 @@ fn stability_tags(item: &clean::Item) -> String {
22302230 tags += & tag_html ( "deprecated" , message) ;
22312231 }
22322232
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" ) ;
22392242 }
22402243
22412244 if let Some ( ref cfg) = item. attrs . cfg {
@@ -2286,15 +2289,13 @@ fn short_stability(item: &clean::Item, cx: &Context) -> Vec<String> {
22862289 ) ) ;
22872290 }
22882291
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 ( ) ;
22982299
22992300 if let Some ( feature) = stab. feature . as_deref ( ) {
23002301 let mut feature = format ! ( "<code>{}</code>" , Escape ( & feature) ) ;
@@ -2310,17 +2311,6 @@ fn short_stability(item: &clean::Item, cx: &Context) -> Vec<String> {
23102311 }
23112312
23122313 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-
23242314 let mut ids = cx. id_map . borrow_mut ( ) ;
23252315 message = format ! (
23262316 "<details><summary>{}</summary>{}</details>" ,
@@ -2336,8 +2326,7 @@ fn short_stability(item: &clean::Item, cx: &Context) -> Vec<String> {
23362326 ) ;
23372327 }
23382328
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) ) ;
23412330 }
23422331
23432332 if let Some ( ref cfg) = item. attrs . cfg {
0 commit comments