about summary refs log tree commit diff
diff options
context:
space:
mode:
authorclubby789 <jamie@hill-daniel.co.uk>2023-03-20 05:21:51 +0000
committerclubby789 <jamie@hill-daniel.co.uk>2023-03-20 05:21:51 +0000
commitc74f2dc5884985ec93f77263769bc26eb0f472d9 (patch)
tree8ab274b26dcef30c168d28de01731d45f0a98631
parent2d0a7def330ed90f416a3429dbb44c5ee2a914e5 (diff)
downloadrust-c74f2dc5884985ec93f77263769bc26eb0f472d9.tar.gz
rust-c74f2dc5884985ec93f77263769bc26eb0f472d9.zip
Fix improper escaping of deprecation reasons
-rw-r--r--src/librustdoc/html/templates/short_item_info.html2
-rw-r--r--tests/rustdoc/deprecated.rs4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/librustdoc/html/templates/short_item_info.html b/src/librustdoc/html/templates/short_item_info.html
index e3125af0e47..75d155e91c2 100644
--- a/src/librustdoc/html/templates/short_item_info.html
+++ b/src/librustdoc/html/templates/short_item_info.html
@@ -2,7 +2,7 @@
     {% when Self::Deprecation with { message } %}
         <div class="stab deprecated"> {# #}
             <span class="emoji">👎</span> {# #}
-            <span>{{message}}</span> {# #}
+            <span>{{message|safe}}</span> {# #}
         </div> {# #}
     {% when Self::Unstable with { feature, tracking } %}
         <div class="stab unstable"> {# #}
diff --git a/tests/rustdoc/deprecated.rs b/tests/rustdoc/deprecated.rs
index 51860441b35..9c9c0945b8f 100644
--- a/tests/rustdoc/deprecated.rs
+++ b/tests/rustdoc/deprecated.rs
@@ -28,6 +28,6 @@ pub struct V;
 pub struct W;
 
 // @matches deprecated/struct.X.html '//*[@class="stab deprecated"]' \
-//      'Deprecated: shorthand reason$'
-#[deprecated = "shorthand reason"]
+//      'Deprecated: shorthand reason: code$'
+#[deprecated = "shorthand reason: `code`"]
 pub struct X;