]> git.lizzy.rs Git - rust.git/commitdiff
Update existing rustdoc test
authorvarkor <github@varkor.com>
Wed, 6 Feb 2019 12:01:28 +0000 (13:01 +0100)
committervarkor <github@varkor.com>
Mon, 11 Feb 2019 11:17:35 +0000 (11:17 +0000)
src/librustdoc/html/render.rs
src/test/rustdoc/deprecated-future.rs

index 00ee24e59c223ba9bf67ddd92c3b7e7c2f0ab7b3..b98f4118614f4eabe6004a38d4f16d550df0fc8d 100644 (file)
@@ -2855,16 +2855,18 @@ 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 { note, .. }) = &item.deprecation() {
+    if let Some(Deprecation { note, since }) = &item.deprecation() {
         // We display deprecation messages for #[deprecated] and #[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 depr) = stab.deprecation {
                 if let Some(ref since) = depr.since {
-                    if stability::deprecation_in_effect(&since) {
-                        message = format!("Deprecated since {}", Escape(&since));
-                    } else {
+                    if !stability::deprecation_in_effect(&since) {
                         message = format!("Deprecating in {}", Escape(&since));
                     }
                 }
index 383afe86cb405e40ee7f66bbefe274cb705ea488..015aade4c880fb555ec0f522eacaa7f31f001bb2 100644 (file)
@@ -1,6 +1,6 @@
 #![feature(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")]
 pub struct S;