missing_copy_implementations
probably shouldn't fire if the type implements Iterator
#98348
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Iterators shouldn't implement copy but the lint suggests it anyway.
Given the following code:
The current output is:
Ideally there should be no warning.
It is widely accepted that iterators shouldn't implement
Copy
because of it being prone to accidentally modifying a copy instead of original (by&mut
). However this lint suggests to implementCopy
anyway. In case the intention is "give the user the warning anyway because he asked for it" the message should probably mention this edge-case and suggestallow
instead.The text was updated successfully, but these errors were encountered: