about summary refs log tree commit diff
path: root/compiler/rustc_lint/src/context/diagnostics.rs
diff options
context:
space:
mode:
authorPeter Jaszkowiak <p.jaszkow@gmail.com>2024-11-25 21:50:26 -0700
committerPeter Jaszkowiak <p.jaszkow@gmail.com>2024-11-25 22:29:14 -0700
commit44f4f67f460a3b3c9bb34851d3d812fbdba81936 (patch)
tree3cdb0d6a403ddb3a2f3c590da97863ea865ba2e1 /compiler/rustc_lint/src/context/diagnostics.rs
parent7db7489f9bc274cb60c4956bfa56de0185eb1b9b (diff)
downloadrust-44f4f67f460a3b3c9bb34851d3d812fbdba81936.tar.gz
rust-44f4f67f460a3b3c9bb34851d3d812fbdba81936.zip
fix confusing diagnostic for reserved `##`
Diffstat (limited to 'compiler/rustc_lint/src/context/diagnostics.rs')
-rw-r--r--compiler/rustc_lint/src/context/diagnostics.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/rustc_lint/src/context/diagnostics.rs b/compiler/rustc_lint/src/context/diagnostics.rs
index 565c3c04252..a3731e31c2b 100644
--- a/compiler/rustc_lint/src/context/diagnostics.rs
+++ b/compiler/rustc_lint/src/context/diagnostics.rs
@@ -176,8 +176,12 @@ pub(super) fn decorate_lint(sess: &Session, diagnostic: BuiltinLintDiag, diag: &
             lints::RawPrefix { label: label_span, suggestion: label_span.shrink_to_hi() }
                 .decorate_lint(diag);
         }
-        BuiltinLintDiag::ReservedString(suggestion) => {
-            lints::ReservedString { suggestion }.decorate_lint(diag);
+        BuiltinLintDiag::ReservedString { is_string, suggestion } => {
+            if is_string {
+                lints::ReservedString { suggestion }.decorate_lint(diag);
+            } else {
+                lints::ReservedMultihash { suggestion }.decorate_lint(diag);
+            }
         }
         BuiltinLintDiag::UnusedBuiltinAttribute { attr_name, macro_name, invoc_span } => {
             lints::UnusedBuiltinAttribute { invoc_span, attr_name, macro_name }.decorate_lint(diag);