Higher ranked types in trait bounds result in confusing diagnostics #124474
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-lifetimes
Area: lifetime related
D-confusing
Diagnostics: Confusing error or lint that should be reworked.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
T-types
Relevant to the types team, which will review and decide on the PR/issue.
Code
Current output
Desired output
Rationale and extra context
for<'a> fn(&'a u32)
in the note makes it seem like it is right (as it's the same as the type for which the trait is implemented), when we actually want to use the'0
. Also it's a good idea to mention how thefor
binders inwhere
clauses are parsed, since this is not that intuitive (the user could have literally pasted the type from the trait impl).Other cases
No response
Rust Version
Anything else?
No response
The text was updated successfully, but these errors were encountered: