about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/errors.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-08-04 07:25:45 +0200
committerGitHub <noreply@github.com>2023-08-04 07:25:45 +0200
commit1f076fe1d8ffd13c3f339cf619dfed5da6dec3f6 (patch)
tree2dfbdf104dee8daf71bf2a0771ec01a5fabb6cce /compiler/rustc_parse/src/errors.rs
parentf36a9b5e18cda84da1790db4c9fd0f85fb8c5ce2 (diff)
parentbbd69e4a4c27f2407326a71a4eb37de694a72b87 (diff)
downloadrust-1f076fe1d8ffd13c3f339cf619dfed5da6dec3f6.tar.gz
rust-1f076fe1d8ffd13c3f339cf619dfed5da6dec3f6.zip
Rollup merge of #113999 - Centri3:macro-arm-expand, r=wesleywiser
Specify macro is invalid in certain contexts

Adds a note when a macro is used where it really shouldn't be.

Closes #113766
Diffstat (limited to 'compiler/rustc_parse/src/errors.rs')
-rw-r--r--compiler/rustc_parse/src/errors.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/rustc_parse/src/errors.rs b/compiler/rustc_parse/src/errors.rs
index 553ef4b51c8..26f38c9156a 100644
--- a/compiler/rustc_parse/src/errors.rs
+++ b/compiler/rustc_parse/src/errors.rs
@@ -1816,6 +1816,12 @@ pub struct UnknownPrefix<'a> {
 }
 
 #[derive(Subdiagnostic)]
+#[note(parse_macro_expands_to_adt_field)]
+pub struct MacroExpandsToAdtField<'a> {
+    pub adt_ty: &'a str,
+}
+
+#[derive(Subdiagnostic)]
 pub enum UnknownPrefixSugg {
     #[suggestion(
         parse_suggestion_br,