Skip to content

Commit 87cd09b

Browse files
committed
Don't display "Deprecated since" for non-rustc deprecated items
1 parent 3737d4d commit 87cd09b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/librustdoc/html/render.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2845,8 +2845,10 @@ fn short_stability(item: &clean::Item, cx: &Context) -> Vec<String> {
28452845
let mut stability = vec![];
28462846
let error_codes = ErrorCodes::from(UnstableFeatures::from_environment().is_nightly_build());
28472847

2848-
if let Some(Deprecation { since, note }) = &item.deprecation() {
2849-
let mut message = if let Some(since) = since {
2848+
if let Some(Deprecation { note, .. }) = &item.deprecation() {
2849+
// We display deprecation messages for #[deprecated] and #[rustc_deprecated]
2850+
// but only display the future-deprecation messages for #[rustc_deprecated].
2851+
let mut message = if let Some(since) = item.stability.deprecation.since {
28502852
if stability::deprecation_in_effect(since) {
28512853
format!("Deprecated since {}", Escape(since))
28522854
} else {

0 commit comments

Comments
 (0)