rustdoc: escape the deprecated and unstable reason text

This commit is contained in:
Esteban Küber
2016-12-08 10:14:35 -08:00
parent 6483bdd860
commit 1ae2245a4e
2 changed files with 7 additions and 7 deletions

View 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()
};