@@ -2703,13 +2703,16 @@ fn stability_tags(item: &clean::Item) -> String {
2703
2703
tags. push_str ( "[<div class='stab deprecated'>Deprecated</div>] " ) ;
2704
2704
}
2705
2705
2706
- if item
2706
+ if let Some ( stab ) = item
2707
2707
. stability
2708
2708
. as_ref ( )
2709
2709
. filter ( |s| s. level == stability:: Unstable )
2710
- . is_some ( )
2711
2710
{
2712
- tags. push_str ( "[<div class='stab unstable'>Experimental</div>] " ) ;
2711
+ if stab. feature . as_ref ( ) . map ( |s| & * * s) == Some ( "rustc_private" ) {
2712
+ tags. push_str ( "[<div class='stab internal'>Internal</div>] " ) ;
2713
+ } else {
2714
+ tags. push_str ( "[<div class='stab unstable'>Experimental</div>] " ) ;
2715
+ }
2713
2716
}
2714
2717
2715
2718
if let Some ( ref cfg) = item. attrs . cfg {
@@ -2752,9 +2755,14 @@ fn short_stability(item: &clean::Item, cx: &Context) -> Vec<String> {
2752
2755
. as_ref ( )
2753
2756
. filter ( |stab| stab. level == stability:: Unstable )
2754
2757
{
2755
- let mut message = String :: from (
2756
- "<span class=microscope>🔬</span> This is a nightly-only experimental API." ,
2757
- ) ;
2758
+ let is_rustc_private = stab. feature . as_ref ( ) . map ( |s| & * * s) == Some ( "rustc_private" ) ;
2759
+
2760
+ let mut message = if is_rustc_private {
2761
+ "<span class='emoji'>⚙️</span> This is an internal compiler API."
2762
+ } else {
2763
+ "<span class='emoji'>🔬</span> This is a nightly-only experimental API."
2764
+ }
2765
+ . to_owned ( ) ;
2758
2766
2759
2767
if let Some ( feature) = stab. feature . as_ref ( ) {
2760
2768
let mut feature = format ! ( "<code>{}</code>" , Escape ( & feature) ) ;
@@ -2770,6 +2778,17 @@ fn short_stability(item: &clean::Item, cx: &Context) -> Vec<String> {
2770
2778
}
2771
2779
2772
2780
if let Some ( unstable_reason) = & stab. unstable_reason {
2781
+ // Provide a more informative message than the compiler help.
2782
+ let unstable_reason = if is_rustc_private {
2783
+ "This crate is being loaded from the sysroot, a permanently unstable location \
2784
+ for private compiler dependencies. It is not intended for general use. Prefer \
2785
+ using a public version of this crate from \
2786
+ [crates.io](https://crates.io) via [`Cargo.toml`]\
2787
+ (https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html)."
2788
+ } else {
2789
+ unstable_reason
2790
+ } ;
2791
+
2773
2792
let mut ids = cx. id_map . borrow_mut ( ) ;
2774
2793
message = format ! (
2775
2794
"<details><summary>{}</summary>{}</details>" ,
@@ -2778,7 +2797,12 @@ fn short_stability(item: &clean::Item, cx: &Context) -> Vec<String> {
2778
2797
) ;
2779
2798
}
2780
2799
2781
- stability. push ( format ! ( "<div class='stab unstable'>{}</div>" , message) )
2800
+ let class = if is_rustc_private {
2801
+ "internal"
2802
+ } else {
2803
+ "unstable"
2804
+ } ;
2805
+ stability. push ( format ! ( "<div class='stab {}'>{}</div>" , class, message) ) ;
2782
2806
}
2783
2807
2784
2808
if let Some ( ref cfg) = item. attrs . cfg {
0 commit comments