-
Notifications
You must be signed in to change notification settings - Fork 13.9k
Slice iter cleanup #146436
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?
Slice iter cleanup #146436
Conversation
This comment has been minimized.
This comment has been minimized.
88ef0cf to
7d88079
Compare
This comment has been minimized.
This comment has been minimized.
9f37d58 to
e62ac74
Compare
|
r? libs |
|
Going to pass this one along. r? libs |
e62ac74 to
62fc4c9
Compare
This comment has been minimized.
This comment has been minimized.
62fc4c9 to
67e3167
Compare
|
@rustbot ready Perhaps a perf run to see if I haven't regressed anything unwittingly? |
| // SAFETY: Nothing else points to or will point to the contents of this slice. | ||
| Some(unsafe { &mut *head }) | ||
| } | ||
| // SAFETY: we have `&mut self`, so are allowed to temporarily materialize a mut slice |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd add that next must not be called if __get_unchecked was called, so invalidating previously returned items does not conflict with TrustedRandomAccess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While that is true, I don't see how this particular next method is special in that regard. So would you then like all next methods of iterators that impl TrustedRandomAccess to get such a comment?
67e3167 to
8a668bd
Compare
|
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
@joboet Thanks for reviewing so far; your comments have been very helpful! I've removed all uses of overflowing_* and also switched all remaining conditions like |
No description provided.