Update existing rustdoc test
This commit is contained in:
parent
2a8a25be37
commit
3dc660f1f5
2 changed files with 8 additions and 6 deletions
|
@ -2855,16 +2855,18 @@ fn short_stability(item: &clean::Item, cx: &Context) -> Vec<String> {
|
||||||
let mut stability = vec![];
|
let mut stability = vec![];
|
||||||
let error_codes = ErrorCodes::from(UnstableFeatures::from_environment().is_nightly_build());
|
let error_codes = ErrorCodes::from(UnstableFeatures::from_environment().is_nightly_build());
|
||||||
|
|
||||||
if let Some(Deprecation { note, .. }) = &item.deprecation() {
|
if let Some(Deprecation { note, since }) = &item.deprecation() {
|
||||||
// We display deprecation messages for #[deprecated] and #[rustc_deprecated]
|
// We display deprecation messages for #[deprecated] and #[rustc_deprecated]
|
||||||
// but only display the future-deprecation messages for #[rustc_deprecated].
|
// but only display the future-deprecation messages for #[rustc_deprecated].
|
||||||
let mut message = String::from("Deprecated");
|
let mut message = if let Some(since) = since {
|
||||||
|
format!("Deprecated since {}", Escape(since))
|
||||||
|
} else {
|
||||||
|
String::from("Deprecated")
|
||||||
|
};
|
||||||
if let Some(ref stab) = item.stability {
|
if let Some(ref stab) = item.stability {
|
||||||
if let Some(ref depr) = stab.deprecation {
|
if let Some(ref depr) = stab.deprecation {
|
||||||
if let Some(ref since) = depr.since {
|
if let Some(ref since) = depr.since {
|
||||||
if stability::deprecation_in_effect(&since) {
|
if !stability::deprecation_in_effect(&since) {
|
||||||
message = format!("Deprecated since {}", Escape(&since));
|
|
||||||
} else {
|
|
||||||
message = format!("Deprecating in {}", Escape(&since));
|
message = format!("Deprecating in {}", Escape(&since));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#![feature(deprecated)]
|
#![feature(deprecated)]
|
||||||
|
|
||||||
// @has deprecated_future/struct.S.html '//*[@class="stab deprecated"]' \
|
// @has deprecated_future/struct.S.html '//*[@class="stab deprecated"]' \
|
||||||
// 'Deprecating in 99.99.99: effectively never'
|
// 'Deprecated since 99.99.99: effectively never'
|
||||||
#[deprecated(since = "99.99.99", note = "effectively never")]
|
#[deprecated(since = "99.99.99", note = "effectively never")]
|
||||||
pub struct S;
|
pub struct S;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue