Confusing error message for misplaced lifetime annotation in reference #75025
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I recently forgot where in a mutable reference the lifetime goes, and got a confusing wall of error messages. Out of the six error messages produced, only the fifth hints at the actual problem, with the rest being misleading.
I think the error messages in this case could be improved in case a newcomer runs into this issue in order to avoid leading them down a false path of trying to figure out trait objects.
Specifically, with the following code
I got the following compiler errors:
I am using stable Rust.
The text was updated successfully, but these errors were encountered: