-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Misleading error message with unnamed lifetimes #30790
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-lifetimes
Area: Lifetimes / regions
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
Comments
If there is no lifetime specified, should we print: A lifetime parameter is needed to bind `&Trait` ? |
The correct code in this case is to specify the return value of the function as |
Proposed output in #47791:
|
bors
added a commit
that referenced
this issue
Feb 3, 2018
Tweak presentation on lifetime trait mismatch - On trait/impl method discrepancy, add label pointing at trait signature. - Point only at method definition when referring to named lifetimes on lifetime mismatch. - When the sub and sup expectations are the same, tweak the output to avoid repeated spans. Fix #30790, CC #18759.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-lifetimes
Area: Lifetimes / regions
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
This code results in a horrible error message:
In particular, note the missing lifetime name on the second line of the error message.
The text was updated successfully, but these errors were encountered: