Skip to content

Commit 3dc660f

Browse files
committed
Update existing rustdoc test
1 parent 2a8a25b commit 3dc660f

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/librustdoc/html/render.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2855,16 +2855,18 @@ fn short_stability(item: &clean::Item, cx: &Context) -> Vec<String> {
28552855
let mut stability = vec![];
28562856
let error_codes = ErrorCodes::from(UnstableFeatures::from_environment().is_nightly_build());
28572857

2858-
if let Some(Deprecation { note, .. }) = &item.deprecation() {
2858+
if let Some(Deprecation { note, since }) = &item.deprecation() {
28592859
// We display deprecation messages for #[deprecated] and #[rustc_deprecated]
28602860
// but only display the future-deprecation messages for #[rustc_deprecated].
2861-
let mut message = String::from("Deprecated");
2861+
let mut message = if let Some(since) = since {
2862+
format!("Deprecated since {}", Escape(since))
2863+
} else {
2864+
String::from("Deprecated")
2865+
};
28622866
if let Some(ref stab) = item.stability {
28632867
if let Some(ref depr) = stab.deprecation {
28642868
if let Some(ref since) = depr.since {
2865-
if stability::deprecation_in_effect(&since) {
2866-
message = format!("Deprecated since {}", Escape(&since));
2867-
} else {
2869+
if !stability::deprecation_in_effect(&since) {
28682870
message = format!("Deprecating in {}", Escape(&since));
28692871
}
28702872
}

src/test/rustdoc/deprecated-future.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#![feature(deprecated)]
22

33
// @has deprecated_future/struct.S.html '//*[@class="stab deprecated"]' \
4-
// 'Deprecating in 99.99.99: effectively never'
4+
// 'Deprecated since 99.99.99: effectively never'
55
#[deprecated(since = "99.99.99", note = "effectively never")]
66
pub struct S;

0 commit comments

Comments
 (0)