Warn using last and count to exhaust an iterator#78225
Warn using last and count to exhaust an iterator#78225Kestrer wants to merge 4 commits intorust-lang:masterfrom
Conversation
|
r? @shepmaster (rust_highfive has picked a reviewer for you, use r? to override) |
|
There's some discussion in #48926 about when to use Marking this as blocked on #48926. |
|
Wouldn't |
My guess is that yes, it'd get optimized out. The By the way: the CI is failing because the expected test output still needs to be updated. You can do that by running |
|
Should I close this or leave it open as blocked? |
|
It might make sense to make this a clippy lint instead. |
|
I have a fuzzy memory that @withoutboats may have had thoughts on one of these specifically... |
|
☔ The latest upstream changes (presumably #76391) made this pull request unmergeable. Please resolve the merge conflicts. |
|
r? @m-ou-se |
|
This was briefly discussed in the libs api meeting recently. See rust-lang/libs-team#35 for the guideline we're using now for Feel free to continue the discussion on #48926. |
This adds the same
#[must_use]attribute as used incollecttocountandlast, as it also does not make sense to not use the result there.