"only named lifetimes allowed in impl Trait" could have a better error message #43719
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-impl-trait
Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
WG-diagnostics
Working group: Diagnostics
gives the error:
The correct fix is
fn iter_values<'a>(&'a self) -> impl Iterator<Item=u32> + 'a
(or useinto_iter
, but that's not always an option), however this error message has no indication that this is the way to go in, in fact not many people are aware of theTrait + 'a
syntax. We probably can do better.The text was updated successfully, but these errors were encountered: