about summary refs log tree commit diff
path: root/src/librustdoc/html/render.rs
diff options
context:
space:
mode:
authorAndy Russell <arussell123@gmail.com>2020-06-27 13:55:15 -0400
committerAndy Russell <arussell123@gmail.com>2020-07-14 19:08:44 -0400
commitc3ee75d956a52791dd0e50391f941030a112f7ef (patch)
treea35aa136151e1bd86218bcf497b0bf71d3cc89cc /src/librustdoc/html/render.rs
parent2002ebacfbca288830a3c308ddc8189705c608fe (diff)
downloadrust-c3ee75d956a52791dd0e50391f941030a112f7ef.tar.gz
rust-c3ee75d956a52791dd0e50391f941030a112f7ef.zip
rustdoc: glue tokens before highlighting
Fixes #72684.

This commit also modifies the signature of `Classifier::new` to avoid
copying the source being highlighted.
Diffstat (limited to 'src/librustdoc/html/render.rs')
-rw-r--r--src/librustdoc/html/render.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs
index 8fa581180ef..7d05caa3aea 100644
--- a/src/librustdoc/html/render.rs
+++ b/src/librustdoc/html/render.rs
@@ -4525,7 +4525,12 @@ fn sidebar_foreign_type(buf: &mut Buffer, it: &clean::Item) {
 
 fn item_macro(w: &mut Buffer, cx: &Context, it: &clean::Item, t: &clean::Macro) {
     wrap_into_docblock(w, |w| {
-        w.write_str(&highlight::render_with_highlighting(&t.source, Some("macro"), None, None))
+        w.write_str(&highlight::render_with_highlighting(
+            t.source.clone(),
+            Some("macro"),
+            None,
+            None,
+        ))
     });
     document(w, cx, it)
 }