Rollup merge of #130725 - GrigorenkoPV:@-in-struct-patterns, r=Nadrieril

Parser: better error messages for `@` in struct patterns
This commit is contained in:
Jubilee 2024-10-02 21:26:58 -07:00 committed by GitHub
commit b7c33e2f20
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 150 additions and 13 deletions

View file

@ -2571,6 +2571,25 @@ pub(crate) struct EnumPatternInsteadOfIdentifier {
pub span: Span,
}
#[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 {