-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Add slice::DrainRaw
for internal use
#127348
Conversation
Rather than encoding things as method calls or token expansions. This isn't directly useful for Iter/IterMut, but sets this up for the next commit that adds another invocation of the macro.
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Add `slice::DrainRaw` for internal use I'd like to separate out this hopefully-non-controversial part of rust-lang#124421 to have fewer commits to juggle there :) r? `@the8472`
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (2132470): comparison URL. Overall result: ❌✅ regressions and improvements - ACTION NEEDEDBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)Results (primary 2.9%, secondary 0.0%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (primary 1.3%, secondary 0.7%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeResults (primary 0.0%, secondary -0.3%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Bootstrap: 698.879s -> 701.919s (0.43%) |
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.
Looks ok overall. The PR description could contain a bit of motivation, since that goes into the git history.
Also, I was not even aware of array::Drain. Once the alloc types get migrated that'll be more reasonable but right now it looks like quite a rube-goldberg machine to implement array::try_map 😅
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.
This file contains a bunch of references to vec::IntoIter
, with the current state that's confusing. Maybe refer to array::Drain instead?
let len = self.len(); | ||
let clamped = len.min(N); | ||
|
||
// SAFETY: By construction, `clamped` is always in-bounds. | ||
let to_copy = unsafe { self.0.skip_forward_unchecked(clamped) }; | ||
if len >= N { |
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 the mix of len and clamped intentional?
ping @scottmcm |
@scottmcm |
These have bitrotted enough that I'll close them as giving up on them for the foreseeeable future. |
I'd like to separate out this hopefully-non-controversial part of #124421 to have fewer commits to juggle there :)
r? @the8472