-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
needless_collect
doesn't understand local borrows
#6066
Comments
So to generalize the problem: If something is borrowed in the |
Might be the same issue, might not be:
Here the first statement can be replaced with the |
something is wrong with tracking where iterators are used, for sure. A small variation on @SKyletoft's example passes without warning: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=f9a04a7d9f7d4409cb91caa73deba23f |
When running
clippy
(0.0.212 (2020-09-17 f3c923a)
) on https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=5b4bbd5f3b653c7d9d8a84d2a63903fa I get the suggestion:However, the original
Iterator
cannot be used, as demonstrated by https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=65b782dbf6cd1731a6906afcd9704e99The text was updated successfully, but these errors were encountered: