-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTD-terseDiagnostics: An error or lint that doesn't give enough information about the problem at hand.Diagnostics: An error or lint that doesn't give enough information about the problem at hand.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Code
struct Foo(a: u8, b: u8);
Current output
error: expected one of `!`, `(`, `)`, `+`, `,`, `::`, or `<`, found `:`
--> src/lib.rs:4:13
|
4 | struct Foo(a: u8, b: u8)
| ^ expected one of 7 possible tokens
Desired output
error: expected one of `!`, `(`, `)`, `+`, `,`, `::`, or `<`, found `:`
--> src/lib.rs:4:13
|
4 | struct Foo(a: u8, b: u8);
| ^ expected one of 7 possible tokens
help: if you wanted to create a tuple struct, remove field names:
--> src/lib.rs:4:13
|
4 ~ struct Foo(a: u8, b: u8);
| --- ---
help: if you wanted to create a regular struct, use curly braces:
--> src/lib.rs:4:13
|
4 - struct Foo(a: u8, b: u8);
4 + struct Foo{a: u8, b: u8}
Rationale and extra context
Context: I was writing a quick reproducer, and made this silly grammatical mistake. But the error message completely threw me off
Other cases
Rust Version
(playground, stable 1.88.0 / beta 1.89.0-beta.7 / nightly 2025-07-28)
Anything else?
@rustbot label +D-terse
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTD-terseDiagnostics: An error or lint that doesn't give enough information about the problem at hand.Diagnostics: An error or lint that doesn't give enough information about the problem at hand.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.