]> git.lizzy.rs Git - rust.git/commitdiff
rustdoc: escape the deprecated and unstable reason text
authorEsteban Küber <esteban@kuber.com.ar>
Thu, 8 Dec 2016 18:14:35 +0000 (10:14 -0800)
committerEsteban Küber <esteban@kuber.com.ar>
Mon, 12 Dec 2016 23:15:45 +0000 (15:15 -0800)
src/liballoc/boxed.rs
src/librustdoc/html/render.rs

index addb056f53429f38511b0d63d0d0b691b60f4f99..5409ade292360d31e96afed17d8ade6d39c5d0f2 100644 (file)
@@ -587,7 +587,7 @@ impl<I: FusedIterator + ?Sized> FusedIterator for Box<I> {}
 /// ```
 #[rustc_paren_sugar]
 #[unstable(feature = "fnbox",
-           reason = "will be deprecated if and when Box<FnOnce> becomes usable", issue = "28796")]
+           reason = "will be deprecated if and when `Box<FnOnce>` becomes usable", issue = "28796")]
 pub trait FnBox<A> {
     type Output;
 
@@ -595,7 +595,7 @@ pub trait FnBox<A> {
 }
 
 #[unstable(feature = "fnbox",
-           reason = "will be deprecated if and when Box<FnOnce> becomes usable", issue = "28796")]
+           reason = "will be deprecated if and when `Box<FnOnce>` becomes usable", issue = "28796")]
 impl<A, F> FnBox<A> for F
     where F: FnOnce<A>
 {
@@ -607,7 +607,7 @@ fn call_box(self: Box<F>, args: A) -> F::Output {
 }
 
 #[unstable(feature = "fnbox",
-           reason = "will be deprecated if and when Box<FnOnce> becomes usable", issue = "28796")]
+           reason = "will be deprecated if and when `Box<FnOnce>` becomes usable", issue = "28796")]
 impl<'a, A, R> FnOnce<A> for Box<FnBox<A, Output = R> + 'a> {
     type Output = R;
 
@@ -617,7 +617,7 @@ extern "rust-call" fn call_once(self, args: A) -> R {
 }
 
 #[unstable(feature = "fnbox",
-           reason = "will be deprecated if and when Box<FnOnce> becomes usable", issue = "28796")]
+           reason = "will be deprecated if and when `Box<FnOnce>` becomes usable", issue = "28796")]
 impl<'a, A, R> FnOnce<A> for Box<FnBox<A, Output = R> + Send + 'a> {
     type Output = R;
 
index e721b66779fffb0facfe3ef02b1085ab35ad354e..29781888fdb4b71113d0b65e514dba3970529e60 100644 (file)
@@ -1844,7 +1844,7 @@ fn short_stability(item: &clean::Item, cx: &Context, show_reason: bool) -> Vec<S
 
     if let Some(stab) = item.stability.as_ref() {
         let deprecated_reason = if show_reason && !stab.deprecated_reason.is_empty() {
-            format!(": {}", stab.deprecated_reason)
+            format!(": {}", Escape(&stab.deprecated_reason))
         } else {
             String::new()
         };
@@ -1875,7 +1875,7 @@ fn short_stability(item: &clean::Item, cx: &Context, show_reason: bool) -> Vec<S
                 String::new()
             };
             let unstable_reason = if show_reason && !stab.unstable_reason.is_empty() {
-                format!(": {}", stab.unstable_reason)
+                format!(": {}", Escape(&stab.unstable_reason))
             } else {
                 String::new()
             };
@@ -1884,7 +1884,7 @@ fn short_stability(item: &clean::Item, cx: &Context, show_reason: bool) -> Vec<S
         };
     } else if let Some(depr) = item.deprecation.as_ref() {
         let note = if show_reason && !depr.note.is_empty() {
-            format!(": {}", depr.note)
+            format!(": {}", Escape(&depr.note))
         } else {
             String::new()
         };