-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Make use of [wrapping_]byte_{add,sub}
#100819
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -64,7 +64,7 @@ macro_rules! iterator { | |||||
// backwards by `n`. `n` must not exceed `self.len()`. | ||||||
macro_rules! zst_shrink { | ||||||
($self: ident, $n: ident) => { | ||||||
$self.end = ($self.end as * $raw_mut u8).wrapping_offset(-$n) as * $raw_mut T; | ||||||
$self.end = $self.end.wrapping_byte_offset(-$n); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change is fine, but I definitely look at it and wonder if it can be
Suggested change
since it's explicitly There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I haven't done this originally because |
||||||
} | ||||||
} | ||||||
|
||||||
|
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.
Is this right? It's using
self.ptr
instead ofself.end
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.
Indeed this is wrong; should be fixed by #101237.
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'm sorry 🥲