-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Implement Iterator::last
for vec::IntoIter
#139773
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
base: master
Are you sure you want to change the base?
Conversation
rustbot has assigned @workingjubilee. Use |
This comment has been minimized.
This comment has been minimized.
ee2370d
to
542bbe7
Compare
Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
I'm unsatisfied that this suppresses the Clippy diagnostic for |
This comment has been minimized.
This comment has been minimized.
542bbe7
to
88b7959
Compare
This comment has been minimized.
This comment has been minimized.
88b7959
to
e6d7a27
Compare
This removes the whole purpose of the test which is to check whether this would modify the drop order of the collection's elements. Could you maybe replace the |
I think making a custom Do you think it's fine that this case is no longer linted for |
I'm confused why you edited my comment. Perhaps you were grabbing the Markdown contents for a reply and edited it instead? I've reverted the edit and reproduce your comment below: @samueltardieu commented 2025-04-14T14:02:22Z:
Independently from the Clippy lint, I wonder if your
For me, it implies that elements are dropped in order. So I'd say that if your change is accepted (and the documentation for |
e6d7a27
to
978a3cb
Compare
I've now made a little wrapper iterator for the test to still exercise that same case, since it wasn't really intending to test the implementation details of |
Ooops, this is was not only unintentional but also unnoticed. Thanks for fixing this. |
Avoid iterating everything when we have random access to the last element.