about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/errors.rs
diff options
context:
space:
mode:
authorJubilee <workingjubilee@gmail.com>2024-10-02 21:26:58 -0700
committerGitHub <noreply@github.com>2024-10-02 21:26:58 -0700
commitb7c33e2f20e5a21231439835ffae167546153e54 (patch)
treebaefd2cafc60b8f6851f846165d2070a24b1bf0e /compiler/rustc_parse/src/errors.rs
parent44f6275e1453822b01d551cd5c93ca16b8753da6 (diff)
parent9cd668beed38a8e98933733854a224c70998bf16 (diff)
downloadrust-b7c33e2f20e5a21231439835ffae167546153e54.tar.gz
rust-b7c33e2f20e5a21231439835ffae167546153e54.zip
Rollup merge of #130725 - GrigorenkoPV:@-in-struct-patterns, r=Nadrieril
Parser: better error messages for `@` in struct patterns
Diffstat (limited to 'compiler/rustc_parse/src/errors.rs')
-rw-r--r--compiler/rustc_parse/src/errors.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/compiler/rustc_parse/src/errors.rs b/compiler/rustc_parse/src/errors.rs
index 20bcefd4fe1..40502158469 100644
--- a/compiler/rustc_parse/src/errors.rs
+++ b/compiler/rustc_parse/src/errors.rs
@@ -2572,6 +2572,25 @@ pub(crate) struct EnumPatternInsteadOfIdentifier {
 }
 
 #[derive(Diagnostic)]
+#[diag(parse_at_dot_dot_in_struct_pattern)]
+pub(crate) struct AtDotDotInStructPattern {
+    #[primary_span]
+    pub span: Span,
+    #[suggestion(code = "", style = "verbose", applicability = "machine-applicable")]
+    pub remove: Span,
+    pub ident: Ident,
+}
+
+#[derive(Diagnostic)]
+#[diag(parse_at_in_struct_pattern)]
+#[note]
+#[help]
+pub(crate) struct AtInStructPattern {
+    #[primary_span]
+    pub span: Span,
+}
+
+#[derive(Diagnostic)]
 #[diag(parse_dot_dot_dot_for_remaining_fields)]
 pub(crate) struct DotDotDotForRemainingFields {
     #[primary_span]