about summary refs log tree commit diff
path: root/compiler/rustc_expand/src/errors.rs
diff options
context:
space:
mode:
authorTshepang Mbambo <tshepang@gmail.com>2023-02-24 23:37:10 +0200
committerTshepang Mbambo <tshepang@gmail.com>2023-02-24 23:37:10 +0200
commitdca52ac835f8c87dfc3167606d1146ce6b9bba11 (patch)
tree15ef651644e42f0100f1e8b49c4a5c9c8f59189b /compiler/rustc_expand/src/errors.rs
parent07c993eba8b76eae497e98433ae075b00f01be10 (diff)
downloadrust-dca52ac835f8c87dfc3167606d1146ce6b9bba11.tar.gz
rust-dca52ac835f8c87dfc3167606d1146ce6b9bba11.zip
make "proc macro panicked" translatable
Diffstat (limited to 'compiler/rustc_expand/src/errors.rs')
-rw-r--r--compiler/rustc_expand/src/errors.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/compiler/rustc_expand/src/errors.rs b/compiler/rustc_expand/src/errors.rs
index d9b2b5f4802..70ab222b484 100644
--- a/compiler/rustc_expand/src/errors.rs
+++ b/compiler/rustc_expand/src/errors.rs
@@ -375,3 +375,18 @@ pub struct TraceMacro {
     #[primary_span]
     pub span: Span,
 }
+
+#[derive(Diagnostic)]
+#[diag(expand_proc_macro_panicked)]
+pub(crate) struct ProcMacroPanicked {
+    #[primary_span]
+    pub span: Span,
+    #[subdiagnostic]
+    pub message: Option<ProcMacroPanickedHelp>,
+}
+
+#[derive(Subdiagnostic)]
+#[help(expand_help)]
+pub(crate) struct ProcMacroPanickedHelp {
+    pub message: String,
+}