1
Fork 0

Add future deprecation warning to rustdoc

This commit is contained in:
varkor 2018-03-19 15:51:11 +00:00
parent c08902b084
commit ecaf1f57ea
2 changed files with 43 additions and 27 deletions

View file

@ -2108,9 +2108,15 @@ fn short_stability(item: &clean::Item, cx: &Context, show_reason: bool) -> Vec<S
} else {
String::new()
};
let text = format!("Deprecated{}{}",
since,
MarkdownHtml(&deprecated_reason));
let text = if stability::deprecation_in_effect(&stab.deprecated_since) {
format!("Deprecated{}{}",
since,
MarkdownHtml(&deprecated_reason))
} else {
format!("This will be deprecated in {}{}",
Escape(&stab.deprecated_since),
MarkdownHtml(&deprecated_reason))
};
stability.push(format!("<div class='stab deprecated'>{}</div>", text))
};
@ -2160,7 +2166,15 @@ fn short_stability(item: &clean::Item, cx: &Context, show_reason: bool) -> Vec<S
String::new()
};
let text = format!("Deprecated{}{}", since, MarkdownHtml(&note));
let text = if stability::deprecation_in_effect(&depr.since) {
format!("Deprecated{}{}",
since,
MarkdownHtml(&note))
} else {
format!("This will be deprecated in {}{}",
Escape(&depr.since),
MarkdownHtml(&note))
};
stability.push(format!("<div class='stab deprecated'>{}</div>", text))
}