Misleading diagnostics for .iter()
#68445
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
D-papercut
Diagnostics: An error or lint that needs small tweaks.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
The following code:
Produces the following error:
Though the suggestion to make a let binding works, and is probably useful for other situations, it's not as elegant here:
The better solution to the compile error is to replace
vec![].iter() ...
withvec![].into_iter()
, and the compiler error message may be updated to reflect this.The text was updated successfully, but these errors were encountered: