]> git.lizzy.rs Git - rust.git/commitdiff
Don't display "Deprecated since" for non-rustc deprecated items
authorvarkor <github@varkor.com>
Tue, 5 Feb 2019 21:51:06 +0000 (22:51 +0100)
committervarkor <github@varkor.com>
Mon, 11 Feb 2019 11:17:35 +0000 (11:17 +0000)
src/librustdoc/html/render.rs

index a85ac19286af533f6b320f69ab59eeaa7f67fddd..3de74491a330bc3a02cf3822a6fe8342a21c813c 100644 (file)
@@ -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 {