From 5df9593f1ad13eac4ca1da281332c8147937cd34 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Tue, 27 Feb 2024 17:39:32 +0100 Subject: [PATCH] Prevent inclusion of whitespace character after macro_rules ident --- src/librustdoc/html/highlight.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/librustdoc/html/highlight.rs b/src/librustdoc/html/highlight.rs index 1cdc792a819a..aa5998876d9a 100644 --- a/src/librustdoc/html/highlight.rs +++ b/src/librustdoc/html/highlight.rs @@ -136,6 +136,7 @@ fn can_merge(class1: Option, class2: Option, text: &str) -> bool { match (class1, class2) { (Some(c1), Some(c2)) => c1.is_equal_to(c2), (Some(Class::Ident(_)), None) | (None, Some(Class::Ident(_))) => true, + (Some(Class::Macro(_)), _) => false, (Some(_), None) | (None, Some(_)) => text.trim().is_empty(), (None, None) => true, }