diff options
| author | Pavel Grigorenko <GrigorenkoPV@ya.ru> | 2024-09-23 02:12:53 +0300 |
|---|---|---|
| committer | Pavel Grigorenko <GrigorenkoPV@ya.ru> | 2024-09-23 02:12:53 +0300 |
| commit | 9cd668beed38a8e98933733854a224c70998bf16 (patch) | |
| tree | 0ac8ea5f3c8b8839224855bac9725e19c323137f /compiler/rustc_parse/src/errors.rs | |
| parent | 8ed95d1d9e149b5242316c91b3849c58f8320470 (diff) | |
| download | rust-9cd668beed38a8e98933733854a224c70998bf16.tar.gz rust-9cd668beed38a8e98933733854a224c70998bf16.zip | |
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.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/compiler/rustc_parse/src/errors.rs b/compiler/rustc_parse/src/errors.rs index e9fe2e6c1dd..e16ab5b4b06 100644 --- a/compiler/rustc_parse/src/errors.rs +++ b/compiler/rustc_parse/src/errors.rs @@ -2584,6 +2584,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] |
