@@ -49,7 +49,7 @@ use std::sync::Arc;
49
49
50
50
use itertools:: Itertools ;
51
51
use rustc_ast_pretty:: pprust;
52
- use rustc_attr:: StabilityLevel ;
52
+ use rustc_attr:: { Deprecation , StabilityLevel } ;
53
53
use rustc_data_structures:: flock;
54
54
use rustc_data_structures:: fx:: { FxHashMap , FxHashSet } ;
55
55
use rustc_data_structures:: sync:: Lrc ;
@@ -65,7 +65,7 @@ use rustc_span::symbol::{kw, sym, Symbol};
65
65
use serde:: ser:: SerializeSeq ;
66
66
use serde:: { Serialize , Serializer } ;
67
67
68
- use crate :: clean:: { self , AttributesExt , Deprecation , GetDefId , RenderedLink , SelfTy , TypeKind } ;
68
+ use crate :: clean:: { self , AttributesExt , GetDefId , RenderedLink , SelfTy , TypeKind } ;
69
69
use crate :: config:: { RenderInfo , RenderOptions } ;
70
70
use crate :: docfs:: { DocFS , PathError } ;
71
71
use crate :: doctree;
@@ -2219,7 +2219,10 @@ fn extra_info_tags(item: &clean::Item, parent: &clean::Item) -> String {
2219
2219
// The trailing space after each tag is to space it properly against the rest of the docs.
2220
2220
if let Some ( depr) = & item. deprecation {
2221
2221
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
+ ) {
2223
2226
message = "Deprecation planned" ;
2224
2227
}
2225
2228
tags += & tag_html ( "deprecated" , "" , message) ;
@@ -2268,20 +2271,24 @@ fn short_item_info(item: &clean::Item, cx: &Context, parent: Option<&clean::Item
2268
2271
let mut extra_info = vec ! [ ] ;
2269
2272
let error_codes = cx. shared . codes ;
2270
2273
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
+ {
2272
2277
// We display deprecation messages for #[deprecated] and #[rustc_deprecated]
2273
2278
// but only display the future-deprecation messages for #[rustc_deprecated].
2274
2279
let mut message = if let Some ( since) = since {
2280
+ let since = & since. as_str ( ) ;
2275
2281
if !stability:: deprecation_in_effect ( is_since_rustc_version, Some ( since) ) {
2276
- format ! ( "Deprecating in {}" , Escape ( & since) )
2282
+ format ! ( "Deprecating in {}" , Escape ( since) )
2277
2283
} else {
2278
- format ! ( "Deprecated since {}" , Escape ( & since) )
2284
+ format ! ( "Deprecated since {}" , Escape ( since) )
2279
2285
}
2280
2286
} else {
2281
2287
String :: from ( "Deprecated" )
2282
2288
} ;
2283
2289
2284
2290
if let Some ( note) = note {
2291
+ let note = note. as_str ( ) ;
2285
2292
let mut ids = cx. id_map . borrow_mut ( ) ;
2286
2293
let html = MarkdownHtml (
2287
2294
& note,
0 commit comments