Unhelpful diagnostic when infered lifetime of return value doesn't match parameter in closure #102400
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-lifetimes
Area: Lifetimes / regions
D-confusing
Diagnostics: Confusing error or lint that should be reworked.
D-terse
Diagnostics: An error or lint that doesn't give enough information about the problem at hand.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Given the following code: Playground
The current output is:
This diagnostic shows the lifetimes of the function item, but omits the return lifetime on the function trait.
(It also shows the wrong fn trait.)
Ideally the output should only show the lifetimes on the fn traits and suggest restricting the lifetime of the parameter:
The text was updated successfully, but these errors were encountered: