suggest adding a where-clause #44507
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.
D-newcomer-roadblock
Diagnostics: Confusing error or lint; hard to understand for new users.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
In some cases, we can suggest the user add a where clause. This applies in cases where there are two named lifetimes already:
Here we currently print:
It'd be nice to add:
Typically, we should only do this outside of trait impls, however, because otherwise the user may not be free to modify the signature. Or, if the trait is declared inside the same crate, we could find the corresponding method in the trait and add a note saying "the where-clause would also have to be added here" or some such thing.
The text was updated successfully, but these errors were encountered: