fn short_stability(item: &clean::Item, cx: &Context) -> Vec<String> {
    let mut stability = vec![];
    let error_codes = cx.shared.codes;

    if let Some(Deprecation { note, since }) = &item.deprecation() {
        // We display deprecation messages for #[deprecated] and #[rustc_deprecated]
        // but only display the future-deprecation messages for #[rustc_deprecated].
        let mut message = if let Some(since) = since {
            format!("Deprecated since {}", Escape(since))
        } else {
            String::from("Deprecated")
        };
        if let Some(ref stab) = item.stability {
            if let Some(ref depr) = stab.deprecation {
                if let Some(ref since) = depr.since {
                    if !stability::deprecation_in_effect(&since) {
                        message = format!("Deprecating in {}", Escape(&since));
                    }
                }
            }
        }

        if let Some(note) = note {
            let mut ids = cx.id_map.borrow_mut();
            let html = MarkdownHtml(
                &note, &mut ids, error_codes, cx.shared.edition, &cx.shared.playground);
            message.push_str(&format!(": {}", html.to_string()));
        }
        stability.push(format!("<div class='stab deprecated'>{}</div>", message));
    }

    if let Some(stab) = item
        .stability
        .as_ref()
        .filter(|stab| stab.level == stability::Unstable)
    {
        let is_rustc_private = stab.feature.as_ref().map(|s| &**s) == Some("rustc_private");

        let mut message = if is_rustc_private {
            "<span class='emoji'>⚙️</span> This is an internal compiler API."
        } else {
            "<span class='emoji'>🔬</span> This is a nightly-only experimental API."
        }
        .to_owned();

        if let Some(feature) = stab.feature.as_ref() {
            let mut feature = format!("<code>{}</code>", Escape(&feature));
            if let (Some(url), Some(issue)) = (&cx.shared.issue_tracker_base_url, stab.issue) {
                feature.push_str(&format!(
                    "&nbsp;<a href=\"{url}{issue}\">#{issue}</a>",
                    url = url,
                    issue = issue
                ));
            }

            message.push_str(&format!(" ({})", feature));
        }

        if let Some(unstable_reason) = &stab.unstable_reason {
            // Provide a more informative message than the compiler help.
            let unstable_reason = if is_rustc_private {
                "This crate is being loaded from the sysroot, a permanently unstable location \
                for private compiler dependencies. It is not intended for general use. Prefer \
                using a public version of this crate from \
                [crates.io](https://crates.io) via [`Cargo.toml`]\
                (https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html)."
            } else {
                unstable_reason
            };

            let mut ids = cx.id_map.borrow_mut();
            message = format!(
                "<details><summary>{}</summary>{}</details>",
                message,
                MarkdownHtml(
                    &unstable_reason,
                    &mut ids,
                    error_codes,
                    cx.shared.edition,
                    &cx.shared.playground,
                ).to_string()
            );
        }

        let class = if is_rustc_private {
            "internal"
        } else {
            "unstable"
        };
        stability.push(format!("<div class='stab {}'>{}</div>", class, message));
    }

    if let Some(ref cfg) = item.attrs.cfg {
        stability.push(format!(
            "<div class='stab portability'>{}</div>",
            cfg.render_long_html()
        ));
    }

    stability
}
/// Render the stability and/or deprecation warning that is displayed at the top of the item's
/// documentation.
Render the stability and/or deprecation warning that is displayed at the top of the item's
documentation.
Render the stability and / or deprecation warning that is displayed at the top of the item ' s documentation .
fn short_stability(item: &clean::Item, cx: &Context) -> Vec<String> {
    let mut stability = vec![];
    let error_codes = cx.shared.codes;
    if let Some(Deprecation { note, since }) = &item.deprecation() {
        // We display deprecation messages for #[deprecated] and #[rustc_deprecated]
        // but only display the future-deprecation messages for #[rustc_deprecated].
        let mut message = if let Some(since) = since {
            format!("Deprecated since {}", Escape(since))
        } else {
            String::from("Deprecated")
        };
        if let Some(ref stab) = item.stability {
            if let Some(ref depr) = stab.deprecation {
                if let Some(ref since) = depr.since {
                    if !stability::deprecation_in_effect(&since) {
                        message = format!("Deprecating in {}", Escape(&since));
                    }
                }
            }
        }
        if let Some(note) = note {
            let mut ids = cx.id_map.borrow_mut();
            let html = MarkdownHtml(
                &note, &mut ids, error_codes, cx.shared.edition, &cx.shared.playground);
            message.push_str(&format!(": {}", html.to_string()));
        }
        stability.push(format!("<div class='stab deprecated'>{}</div>", message));
    }
    if let Some(stab) = item
        .stability
        .as_ref()
        .filter(|stab| stab.level == stability::Unstable)
    {
        let is_rustc_private = stab.feature.as_ref().map(|s| &**s) == Some("rustc_private");
        let mut message = if is_rustc_private {
            "<span class='emoji'>⚙️</span> This is an internal compiler API."
        } else {
            "<span class='emoji'>🔬</span> This is a nightly-only experimental API."
        }
        .to_owned();
        if let Some(feature) = stab.feature.as_ref() {
            let mut feature = format!("<code>{}</code>", Escape(&feature));
            if let (Some(url), Some(issue)) = (&cx.shared.issue_tracker_base_url, stab.issue) {
                feature.push_str(&format!(
                    "&nbsp;<a href=\"{url}{issue}\">#{issue}</a>",
                    url = url,
                    issue = issue
                ));
            }
            message.push_str(&format!(" ({})", feature));
        }
        if let Some(unstable_reason) = &stab.unstable_reason {
            // Provide a more informative message than the compiler help.
            let unstable_reason = if is_rustc_private {
                "This crate is being loaded from the sysroot, a permanently unstable location \
                for private compiler dependencies. It is not intended for general use. Prefer \
                using a public version of this crate from \
                [crates.io](https://crates.io) via [`Cargo.toml`]\
                (https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html)."
            } else {
                unstable_reason
            };
            let mut ids = cx.id_map.borrow_mut();
            message = format!(
                "<details><summary>{}</summary>{}</details>",
                message,
                MarkdownHtml(
                    &unstable_reason,
                    &mut ids,
                    error_codes,
                    cx.shared.edition,
                    &cx.shared.playground,
                ).to_string()
            );
        }
        let class = if is_rustc_private {
            "internal"
        } else {
            "unstable"
        };
        stability.push(format!("<div class='stab {}'>{}</div>", class, message));
    }
    if let Some(ref cfg) = item.attrs.cfg {
        stability.push(format!(
            "<div class='stab portability'>{}</div>",
            cfg.render_long_html()
        ));
    }
    stability
}
fn short_stability ( item : & clean :: Item , cx : & Context ) -> Vec < String > { let mut stability = vec ! [ ] ; let error_codes = cx . shared . codes ; if let Some ( Deprecation { note , since } ) = & item . deprecation ( ) { // We display deprecation messages for #[deprecated] and #[rustc_deprecated] // but only display the future-deprecation messages for #[rustc_deprecated]. let mut message = if let Some ( since ) = since { format ! ( " " Escape ( since ) ) } else { String :: from ( " " ) } ; if let Some ( ref stab ) = item . stability { if let Some ( ref depr ) = stab . deprecation { if let Some ( ref since ) = depr . since { if ! stability :: deprecation_in_effect ( & since ) { message = format ! ( " " Escape ( since ) ) ; } } } } if let Some ( note ) = note { let mut ids = cx . id_map . borrow_mut ( ) ; let html = MarkdownHtml ( & note , & mut ids , error_codes , cx . shared . edition , & cx . shared . playground ) ; message . push_str ( & format ! ( " " html to_string ( ) ) ) ; } stability . push ( format ! ( " " message ) ) ; } if let Some ( stab ) = item . stability . as_ref ( ) . filter ( | stab | stab . level == stability :: Unstable ) { let is_rustc_private = stab . feature . as_ref ( ) . map ( | s | & * * s ) == Some ( " " ) ; let mut message = if is_rustc_private { " } else { " } . to_owned ( ) ; if let Some ( feature ) = stab . feature . as_ref ( ) { let mut feature = format ! ( " " Escape ( feature ) ) ; if let ( Some ( url ) , Some ( issue ) ) = ( & cx . shared . issue_tracker_base_url , stab . issue ) { feature . push_str ( & format ! ( " \" \" " url url issue issue ) ) ; } message . push_str ( & format ! ( " " feature ) ) ; } if let Some ( unstable_reason ) = & stab . unstable_reason { // Provide a more informative message than the compiler help. let unstable_reason = if is_rustc_private { " \
 \
 \
 \
 " } else { unstable_reason } ; let mut ids = cx . id_map . borrow_mut ( ) ; message = format ! ( " " message MarkdownHtml ( unstable_reason mut ids error_codes cx shared edition cx shared playground ) to_string ( ) ) ; } let class = if is_rustc_private { " " } else { " " } ; stability . push ( format ! ( " " class message ) ) ; } if let Some ( ref cfg ) = item . attrs . cfg { stability . push ( format ! ( " " cfg render_long_html ( ) ) ) ; } stability }
Render the stability and/or deprecation warning that is displayed at the top of the item's
documentation.
Render the stability and / or deprecation warning that is displayed at the top of the item ' s documentation .
item
&clean::Item
cx
&Context
item
&clean::Item
cx
&Context