Skip to content

Commit 1ae2245

Browse files
committed
rustdoc: escape the deprecated and unstable reason text
1 parent 6483bdd commit 1ae2245

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/liballoc/boxed.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -587,15 +587,15 @@ impl<I: FusedIterator + ?Sized> FusedIterator for Box<I> {}
587587
/// ```
588588
#[rustc_paren_sugar]
589589
#[unstable(feature = "fnbox",
590-
reason = "will be deprecated if and when Box<FnOnce> becomes usable", issue = "28796")]
590+
reason = "will be deprecated if and when `Box<FnOnce>` becomes usable", issue = "28796")]
591591
pub trait FnBox<A> {
592592
type Output;
593593

594594
fn call_box(self: Box<Self>, args: A) -> Self::Output;
595595
}
596596

597597
#[unstable(feature = "fnbox",
598-
reason = "will be deprecated if and when Box<FnOnce> becomes usable", issue = "28796")]
598+
reason = "will be deprecated if and when `Box<FnOnce>` becomes usable", issue = "28796")]
599599
impl<A, F> FnBox<A> for F
600600
where F: FnOnce<A>
601601
{
@@ -607,7 +607,7 @@ impl<A, F> FnBox<A> for F
607607
}
608608

609609
#[unstable(feature = "fnbox",
610-
reason = "will be deprecated if and when Box<FnOnce> becomes usable", issue = "28796")]
610+
reason = "will be deprecated if and when `Box<FnOnce>` becomes usable", issue = "28796")]
611611
impl<'a, A, R> FnOnce<A> for Box<FnBox<A, Output = R> + 'a> {
612612
type Output = R;
613613

@@ -617,7 +617,7 @@ impl<'a, A, R> FnOnce<A> for Box<FnBox<A, Output = R> + 'a> {
617617
}
618618

619619
#[unstable(feature = "fnbox",
620-
reason = "will be deprecated if and when Box<FnOnce> becomes usable", issue = "28796")]
620+
reason = "will be deprecated if and when `Box<FnOnce>` becomes usable", issue = "28796")]
621621
impl<'a, A, R> FnOnce<A> for Box<FnBox<A, Output = R> + Send + 'a> {
622622
type Output = R;
623623

src/librustdoc/html/render.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1844,7 +1844,7 @@ fn short_stability(item: &clean::Item, cx: &Context, show_reason: bool) -> Vec<S
18441844

18451845
if let Some(stab) = item.stability.as_ref() {
18461846
let deprecated_reason = if show_reason && !stab.deprecated_reason.is_empty() {
1847-
format!(": {}", stab.deprecated_reason)
1847+
format!(": {}", Escape(&stab.deprecated_reason))
18481848
} else {
18491849
String::new()
18501850
};
@@ -1875,7 +1875,7 @@ fn short_stability(item: &clean::Item, cx: &Context, show_reason: bool) -> Vec<S
18751875
String::new()
18761876
};
18771877
let unstable_reason = if show_reason && !stab.unstable_reason.is_empty() {
1878-
format!(": {}", stab.unstable_reason)
1878+
format!(": {}", Escape(&stab.unstable_reason))
18791879
} else {
18801880
String::new()
18811881
};
@@ -1884,7 +1884,7 @@ fn short_stability(item: &clean::Item, cx: &Context, show_reason: bool) -> Vec<S
18841884
};
18851885
} else if let Some(depr) = item.deprecation.as_ref() {
18861886
let note = if show_reason && !depr.note.is_empty() {
1887-
format!(": {}", depr.note)
1887+
format!(": {}", Escape(&depr.note))
18881888
} else {
18891889
String::new()
18901890
};

0 commit comments

Comments
 (0)