fn short_item_info(
    item: &clean::Item,
    cx: &Context<'_>,
    parent: Option<&clean::Item>,
) -> Vec<String> {
    let mut extra_info = vec![];
    let error_codes = cx.shared.codes;

    if let Some(Deprecation { note, since, is_since_rustc_version, suggestion: _ }) =
        item.deprecation(cx.tcx())
    {
        // 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 {
            let since = &since.as_str();
            if !stability::deprecation_in_effect(is_since_rustc_version, Some(since)) {
                if *since == "TBD" {
                    String::from("Deprecating in a future Rust version")
                } else {
                    format!("Deprecating in {}", Escape(since))
                }
            } else {
                format!("Deprecated since {}", Escape(since))
            }
        } else {
            String::from("Deprecated")
        };

        if let Some(note) = note {
            let note = note.as_str();
            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.into_string()));
        }
        extra_info.push(format!(
            "<div class=\"stab deprecated\"><span class=\"emoji\">👎</span> {}</div>",
            message,
        ));
    }

    // Render unstable items. But don't render "rustc_private" crates (internal compiler crates).
    // Those crates are permanently unstable so it makes no sense to render "unstable" everywhere.
    if let Some((StabilityLevel::Unstable { reason, issue, .. }, feature)) = item
        .stability(cx.tcx())
        .as_ref()
        .filter(|stab| stab.feature != sym::rustc_private)
        .map(|stab| (stab.level, stab.feature))
    {
        let mut message =
            "<span class=\"emoji\">🔬</span> This is a nightly-only experimental API.".to_owned();

        let mut feature = format!("<code>{}</code>", Escape(&feature.as_str()));
        if let (Some(url), Some(issue)) = (&cx.shared.issue_tracker_base_url, 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) = reason {
            let mut ids = cx.id_map.borrow_mut();
            message = format!(
                "<details><summary>{}</summary>{}</details>",
                message,
                MarkdownHtml(
                    &unstable_reason.as_str(),
                    &mut ids,
                    error_codes,
                    cx.shared.edition,
                    &cx.shared.playground,
                )
                .into_string()
            );
        }

        extra_info.push(format!("<div class=\"stab unstable\">{}</div>", message));
    }

    if let Some(portability) = portability(item, parent) {
        extra_info.push(portability);
    }

    extra_info
}
/// Render the stability, deprecation and portability information that is displayed at the top of
/// the item's documentation.
Render the stability, deprecation and portability information that is displayed at the top of
the item's documentation.
Render the stability deprecation and portability information that is displayed at the top of the item ' s documentation .
fn short_item_info(
    item: &clean::Item,
    cx: &Context<'_>,
    parent: Option<&clean::Item>,
) -> Vec<String> {
    let mut extra_info = vec![];
    let error_codes = cx.shared.codes;
    if let Some(Deprecation { note, since, is_since_rustc_version, suggestion: _ }) =
        item.deprecation(cx.tcx())
    {
        // 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 {
            let since = &since.as_str();
            if !stability::deprecation_in_effect(is_since_rustc_version, Some(since)) {
                if *since == "TBD" {
                    String::from("Deprecating in a future Rust version")
                } else {
                    format!("Deprecating in {}", Escape(since))
                }
            } else {
                format!("Deprecated since {}", Escape(since))
            }
        } else {
            String::from("Deprecated")
        };
        if let Some(note) = note {
            let note = note.as_str();
            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.into_string()));
        }
        extra_info.push(format!(
            "<div class=\"stab deprecated\"><span class=\"emoji\">👎</span> {}</div>",
            message,
        ));
    }
    // Render unstable items. But don't render "rustc_private" crates (internal compiler crates).
    // Those crates are permanently unstable so it makes no sense to render "unstable" everywhere.
    if let Some((StabilityLevel::Unstable { reason, issue, .. }, feature)) = item
        .stability(cx.tcx())
        .as_ref()
        .filter(|stab| stab.feature != sym::rustc_private)
        .map(|stab| (stab.level, stab.feature))
    {
        let mut message =
            "<span class=\"emoji\">🔬</span> This is a nightly-only experimental API.".to_owned();
        let mut feature = format!("<code>{}</code>", Escape(&feature.as_str()));
        if let (Some(url), Some(issue)) = (&cx.shared.issue_tracker_base_url, 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) = reason {
            let mut ids = cx.id_map.borrow_mut();
            message = format!(
                "<details><summary>{}</summary>{}</details>",
                message,
                MarkdownHtml(
                    &unstable_reason.as_str(),
                    &mut ids,
                    error_codes,
                    cx.shared.edition,
                    &cx.shared.playground,
                )
                .into_string()
            );
        }
        extra_info.push(format!("<div class=\"stab unstable\">{}</div>", message));
    }
    if let Some(portability) = portability(item, parent) {
        extra_info.push(portability);
    }
    extra_info
}
fn short_item_info ( item : & clean :: Item , cx : & Context < ' _ > , parent : Option < & clean :: Item > , ) -> Vec < String > { let mut extra_info = vec ! [ ] ; let error_codes = cx . shared . codes ; if let Some ( Deprecation { note , since , is_since_rustc_version , suggestion : _ } ) = item . deprecation ( cx . tcx ( ) ) { // 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 { let since = & since . as_str ( ) ; if ! stability :: deprecation_in_effect ( is_since_rustc_version , Some ( since ) ) { if * since == " " { String :: from ( " " ) } else { format ! ( " " Escape ( since ) ) } } else { format ! ( " " Escape ( since ) ) } } else { String :: from ( " " ) } ; if let Some ( note ) = note { let note = note . as_str ( ) ; 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 into_string ( ) ) ) ; } extra_info . push ( format ! ( " \" \" \" \" message ) ) ; } // Render unstable items. But don't render "rustc_private" crates (internal compiler crates). // Those crates are permanently unstable so it makes no sense to render "unstable" everywhere. if let Some ( ( StabilityLevel :: Unstable { reason , issue , .. } , feature ) ) = item . stability ( cx . tcx ( ) ) . as_ref ( ) . filter ( | stab | stab . feature != sym :: rustc_private ) . map ( | stab | ( stab . level , stab . feature ) ) { let mut message = " \" \" o _ owned(); let mut feature = format ! ( " " Escape ( feature as_str ( ) ) ) ; if let ( Some ( url ) , Some ( issue ) ) = ( & cx . shared . issue_tracker_base_url , issue ) { feature . push_str ( & format ! ( " \" \" " url url issue issue ) ) ; } message . push_str ( & format ! ( " " feature ) ) ; if let Some ( unstable_reason ) = reason { let mut ids = cx . id_map . borrow_mut ( ) ; message = format ! ( " " message MarkdownHtml ( unstable_reason as_str ( ) mut ids error_codes cx shared edition cx shared playground ) into_string ( ) ) ; } extra_info . push ( format ! ( " \" \" " message ) ) ; } if let Some ( portability ) = portability ( item , parent ) { extra_info . push ( portability ) ; } extra_info }
Render the stability, deprecation and portability information that is displayed at the top of
the item's documentation.
Render the stability deprecation and portability information that is displayed at the top of the item ' s documentation .
item
&clean::Item
cx
&Context<'_>
parent
Option<&clean::Item>
item
&clean::Item
cx
&Context<'_>
parent
Option<&clean::Item>