diff options
| author | varkor <github@varkor.com> | 2019-02-05 22:51:06 +0100 |
|---|---|---|
| committer | varkor <github@varkor.com> | 2019-02-11 11:17:35 +0000 |
| commit | 87cd09b94c00a07f2bd19366c71ac0c12579ee0e (patch) | |
| tree | 7572a9dd9a969124b1a500e3fd8d8274347f2642 /src | |
| parent | 3737d4d87db3961427f2548b19cb85f67602d741 (diff) | |
| download | rust-87cd09b94c00a07f2bd19366c71ac0c12579ee0e.tar.gz rust-87cd09b94c00a07f2bd19366c71ac0c12579ee0e.zip | |
Don't display "Deprecated since" for non-rustc deprecated items
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustdoc/html/render.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index a85ac19286a..3de74491a33 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -2845,8 +2845,10 @@ fn short_stability(item: &clean::Item, cx: &Context) -> Vec<String> { let mut stability = vec![]; let error_codes = ErrorCodes::from(UnstableFeatures::from_environment().is_nightly_build()); - if let Some(Deprecation { since, note }) = &item.deprecation() { - let mut message = if let Some(since) = since { + if let Some(Deprecation { note, .. }) = &item.deprecation() { + // We display deprecation messages for #[deprecated] and #[rustc_deprecated] + // but only display the future-deprecation messages for #[rustc_deprecated]. + let mut message = if let Some(since) = item.stability.deprecation.since { if stability::deprecation_in_effect(since) { format!("Deprecated since {}", Escape(since)) } else { |
