-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Suggest Explicit Lifetime for Associated Type Bindings #123245
Suggest Explicit Lifetime for Associated Type Bindings #123245
Conversation
], | ||
Applicability::MachineApplicable, | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is existing diagnostic code in rustc_resolve::late::diagnostics
. We should adapt and reuse add_missing_lifetime_specifiers_label
and suggest_introducing_lifetime
.
CC #123713 (comment) (last paragraph). The “proper” way to fix #122025 is to stash the diagnostic in I've only glanced at the changes made in this PR but you seem to be taking the alternative approach that I've dubbed “heuristic in |
☔ The latest upstream changes (presumably #123968) made this pull request unmergeable. Please resolve the merge conflicts. |
@veera-sivarajan any updates on this? thanks |
Still working on it. Thanks for checking. |
Fixes #122025
This PR suggests an explicit lifetime annotation for associated type bindings. Previously, this error suggested an incorrect HRTB.
Please let me know if there's a better way to figure
is_associated_type_binding
. Also, this suggestion usesApplicability::MaybeIncorrect
as the suggestion can be incorrect when a trait's input lifetimes are also missing.