Implement DoubleEndedIterator::next_chunk_back#156737
Conversation
|
r? @tgross35 rustbot has assigned @tgross35. Use Why was this reviewer chosen?The reviewer was selected based on:
|
7cb34f0 to
210d0a1
Compare
This comment has been minimized.
This comment has been minimized.
210d0a1 to
41f9ab9
Compare
This comment has been minimized.
This comment has been minimized.
41f9ab9 to
0688940
Compare
This comment has been minimized.
This comment has been minimized.
0688940 to
9d29265
Compare
9d29265 to
db0f4cc
Compare
|
r? libs |
There was a problem hiding this comment.
Some minor nits to pick and one case of "I don't think that's what we want to indicate to the compiler".
I'm also a little worried about adding const stuff as this has recently been a topic of discussion - this is in line with the fn next_chunk and doesn't seem like a problem in that sense, but I figured it's best to mention it as well.
|
Reminder, once the PR becomes ready for a review, use |
Yeah, I'm aware that the Rust libs team are cautious with constifying functions/methods. I figured in this case it was fine for consistency with |
db0f4cc to
2ea9ac3
Compare
This comment has been minimized.
This comment has been minimized.
|
Did they change how |
Clarify that GuardBack initializes arrays from the end. Restore performance note for iter_next_chunk_erased regarding optimization issues.
I copied the impl block from Guard without noticing that Destruct was only there for const contexts. Consumed the suggestion, thanks. Co-authored-by: Chayim Refael Friedman <chayimfr@gmail.com>
…troduced next_chunk_back implementation in IntoIter, updated documentation, and added test cases for DoubleEndedIterator::next_chunk_back
2ea9ac3 to
bfd1ba6
Compare
|
This PR was rebased onto a different main 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. |
|
Just rebased main onto this branch, so the tidy script works appropriately in where to put the |
|
Just in case, I'm going to mark this as libs-api nominated on whether or not constifying certain functions here for @rustbot label +I-libs-api-nominated |
|
Per today's libs-api meeting, we'd rather keep this non-const for now unless there's a concrete usecase stronger than just consistency. Thanks ^^ |
|
@aapoalas @nia-e actually, these functions need When @vinDelphini started working on this, that I think there's no other changes I can make to this PR. Edit: Actually nevermind. We can use the |
View all comments
This PR builds off on @vinDelphini's PR on introducing
DoubleEndedIterator::next_chunk_back(which will be used in a follow up PR to optimizeArrayChunks::try_rfoldonce merged). This was in the works since late Jan and I thought to pick it up and get this over the finish line as vinDelphini has been away from the PR for a couple of months. I've made sure to pull from vinDelphini's branch to keep him authored on the commits he made.Other things introduced from this PR is specialization like done for
Iterator::next_chunk, constifying some stuff, making a customDoubleEndedIterator::next_chunk_backforIntoIter(since it also has a custom impl ofIterator::next_chunk), and a bunch of tests mirroring that ofIterator::next_chunk.There's no tracking issue for this yet, but the ACP for this introduction is here. I'll create the tracking issue for this soon.
Actually, can we have
DoubleEndedIterator::next_chunk_backunderneathIterator::next_chunktracking issue?