Suggest Explicit Lifetime for Associated Type Bindings#123245
Suggest Explicit Lifetime for Associated Type Bindings#123245veera-sivarajan wants to merge 2 commits intorust-lang:masterfrom
Conversation
| ], | ||
| Applicability::MachineApplicable, | ||
| ); | ||
| } |
There was a problem hiding this comment.
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::MaybeIncorrectas the suggestion can be incorrect when a trait's input lifetimes are also missing.