Lint against Iterator::map
receiving a callable that returns ()
#106991
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-lints
Area: Lints (warnings about flaws in source code) such as unused_mut.
D-newcomer-roadblock
Diagnostics: Confusing error or lint; hard to understand for new users.
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.
Code
Current output
Desired output
Rationale and extra context
Mapping to
()
is almost always a mistake. Thefor_each
suggestion should only be emitted if it would make sense withfoo
, like if it modifies the argument or has side-effects like printing or logging (the later would be hard to check for).Other cases
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: