@@ -49,7 +49,7 @@ use std::sync::Arc;
4949
5050use itertools:: Itertools ;
5151use rustc_ast_pretty:: pprust;
52- use rustc_attr:: StabilityLevel ;
52+ use rustc_attr:: { Deprecation , StabilityLevel } ;
5353use rustc_data_structures:: flock;
5454use rustc_data_structures:: fx:: { FxHashMap , FxHashSet } ;
5555use rustc_data_structures:: sync:: Lrc ;
@@ -65,7 +65,7 @@ use rustc_span::symbol::{sym, Symbol};
6565use serde:: ser:: SerializeSeq ;
6666use serde:: { Serialize , Serializer } ;
6767
68- use crate :: clean:: { self , AttributesExt , Deprecation , GetDefId , RenderedLink , SelfTy , TypeKind } ;
68+ use crate :: clean:: { self , AttributesExt , GetDefId , RenderedLink , SelfTy , TypeKind } ;
6969use crate :: config:: { RenderInfo , RenderOptions } ;
7070use crate :: docfs:: { DocFS , PathError } ;
7171use crate :: doctree;
@@ -2219,7 +2219,10 @@ fn extra_info_tags(item: &clean::Item, parent: &clean::Item) -> String {
22192219 // The trailing space after each tag is to space it properly against the rest of the docs.
22202220 if let Some ( depr) = & item. deprecation {
22212221 let mut message = "Deprecated" ;
2222- if !stability:: deprecation_in_effect ( depr. is_since_rustc_version , depr. since . as_deref ( ) ) {
2222+ if !stability:: deprecation_in_effect (
2223+ depr. is_since_rustc_version ,
2224+ depr. since . map ( |s| s. as_str ( ) ) . as_deref ( ) ,
2225+ ) {
22232226 message = "Deprecation planned" ;
22242227 }
22252228 tags += & tag_html ( "deprecated" , "" , message) ;
@@ -2268,20 +2271,24 @@ fn short_item_info(item: &clean::Item, cx: &Context, parent: Option<&clean::Item
22682271 let mut extra_info = vec ! [ ] ;
22692272 let error_codes = cx. shared . codes ;
22702273
2271- if let Some ( Deprecation { ref note, ref since, is_since_rustc_version } ) = item. deprecation {
2274+ if let Some ( Deprecation { note, since, is_since_rustc_version, suggestion : _ } ) =
2275+ item. deprecation
2276+ {
22722277 // We display deprecation messages for #[deprecated] and #[rustc_deprecated]
22732278 // but only display the future-deprecation messages for #[rustc_deprecated].
22742279 let mut message = if let Some ( since) = since {
2280+ let since = & since. as_str ( ) ;
22752281 if !stability:: deprecation_in_effect ( is_since_rustc_version, Some ( since) ) {
2276- format ! ( "Deprecating in {}" , Escape ( & since) )
2282+ format ! ( "Deprecating in {}" , Escape ( since) )
22772283 } else {
2278- format ! ( "Deprecated since {}" , Escape ( & since) )
2284+ format ! ( "Deprecated since {}" , Escape ( since) )
22792285 }
22802286 } else {
22812287 String :: from ( "Deprecated" )
22822288 } ;
22832289
22842290 if let Some ( note) = note {
2291+ let note = note. as_str ( ) ;
22852292 let mut ids = cx. id_map . borrow_mut ( ) ;
22862293 let html = MarkdownHtml (
22872294 & note,
0 commit comments