Bad generic error for incorrectly placed where
clause for tuple struct
#100790
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-parser
Area: The parsing of Rust source code to an AST
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Given the following code: [playground]
The current output is:
What appears to be happening is that we're trying to parse this as a unit struct (which can have a
where
clause), and thus trying to parse the struct tuple as a type to bound.With a tuple visibility:
Ideally,
;
instead of:
(or a currently-just-for-diagnostics=
) and then reinterpret the tuple type as a tuple struct tuple, printing a more useful error;pub
visibility marker and retry to parse as a tuple struct definition tuple in order to provide the nicer error.The text was updated successfully, but these errors were encountered: