Recover from malformed trait bounds of the form Fn<'a>()
#103490
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-parser
Area: The parsing of Rust source code to an AST
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
D-newcomer-roadblock
Diagnostics: Confusing error or lint; hard to understand for new users.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
The following code:
currently produces a heap of semi-helpful diagnostics:
stderr (7 errors)
when instead we could special-case this and emit a single (or at least fewer) diagnostic that suggests the following:
If the bound in not inside
impl Trait
, like in:we currently emit the following:
which is less verbose for sure but still, we should provide the same suggestion I propose above.
Related issue: #103487.
@rustbot label A-parser A-suggestion-diagnostics D-newcomer-roadblock
The text was updated successfully, but these errors were encountered: