-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
implement TrustedRandomAccess
for Take
iterator adapter
#83990
Merged
Merged
+22
−1
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rustbot
added
the
T-libs
Relevant to the library team, which will review and decide on the PR/issue.
label
Apr 8, 2021
r? @kennytm (rust-highfive has picked a reviewer for you, use r? to override) |
rust-highfive
added
the
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
label
Apr 8, 2021
This comment has been minimized.
This comment has been minimized.
the8472
force-pushed
the
take-trusted-len
branch
from
April 8, 2021 08:28
eb70d35
to
37a5b51
Compare
dtolnay
approved these changes
Apr 21, 2021
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.
Great!
@bors r+ |
📌 Commit 37a5b51 has been approved by |
🌲 The tree is currently closed for pull requests below priority 1000. This pull request will be tested once the tree is reopened. |
bors
added
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Apr 21, 2021
Dylan-DPC-zz
pushed a commit
to Dylan-DPC-zz/rust
that referenced
this pull request
Apr 22, 2021
implement `TrustedRandomAccess` for `Take` iterator adapter `TrustedRandomAccess` requires the iterator length to fit within `usize`. `take(n)` only constrains the upper bound of an iterator. So if the inner is `TrustedRandomAccess` (which already implies a finite length) then so can be `Take`. `@rustbot` label T-libs-impl
Dylan-DPC-zz
pushed a commit
to Dylan-DPC-zz/rust
that referenced
this pull request
Apr 22, 2021
implement `TrustedRandomAccess` for `Take` iterator adapter `TrustedRandomAccess` requires the iterator length to fit within `usize`. `take(n)` only constrains the upper bound of an iterator. So if the inner is `TrustedRandomAccess` (which already implies a finite length) then so can be `Take`. ``@rustbot`` label T-libs-impl
This was referenced Apr 22, 2021
Dylan-DPC-zz
pushed a commit
to Dylan-DPC-zz/rust
that referenced
this pull request
Apr 22, 2021
implement `TrustedRandomAccess` for `Take` iterator adapter `TrustedRandomAccess` requires the iterator length to fit within `usize`. `take(n)` only constrains the upper bound of an iterator. So if the inner is `TrustedRandomAccess` (which already implies a finite length) then so can be `Take`. ```@rustbot``` label T-libs-impl
Dylan-DPC-zz
pushed a commit
to Dylan-DPC-zz/rust
that referenced
this pull request
Apr 22, 2021
implement `TrustedRandomAccess` for `Take` iterator adapter `TrustedRandomAccess` requires the iterator length to fit within `usize`. `take(n)` only constrains the upper bound of an iterator. So if the inner is `TrustedRandomAccess` (which already implies a finite length) then so can be `Take`. ````@rustbot```` label T-libs-impl
Dylan-DPC-zz
pushed a commit
to Dylan-DPC-zz/rust
that referenced
this pull request
Apr 23, 2021
implement `TrustedRandomAccess` for `Take` iterator adapter `TrustedRandomAccess` requires the iterator length to fit within `usize`. `take(n)` only constrains the upper bound of an iterator. So if the inner is `TrustedRandomAccess` (which already implies a finite length) then so can be `Take`. `````@rustbot````` label T-libs-impl
JohnTitor
added a commit
to JohnTitor/rust
that referenced
this pull request
Apr 23, 2021
implement `TrustedRandomAccess` for `Take` iterator adapter `TrustedRandomAccess` requires the iterator length to fit within `usize`. `take(n)` only constrains the upper bound of an iterator. So if the inner is `TrustedRandomAccess` (which already implies a finite length) then so can be `Take`. ``````@rustbot`````` label T-libs-impl
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Apr 24, 2021
Rollup of 10 pull requests Successful merges: - rust-lang#83990 (implement `TrustedRandomAccess` for `Take` iterator adapter) - rust-lang#84250 (bootstrap: use bash on illumos to run install scripts) - rust-lang#84320 (Use details tag for trait implementors.) - rust-lang#84436 (Make a few functions private) - rust-lang#84453 (Document From implementations for Waker and RawWaker) - rust-lang#84458 (Remove unnecessary fields and parameters in rustdoc) - rust-lang#84485 (Add some associated type bounds tests) - rust-lang#84489 (Mention FusedIterator case in Iterator::fuse doc) - rust-lang#84492 (rustdoc: Remove unnecessary dummy span) - rust-lang#84496 (Add some specialization tests) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This was referenced Jun 3, 2021
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jun 9, 2021
Revert "implement TrustedRandomAccess for Take iterator adapter" This reverts commit 37a5b51 (rust-lang#83990). The original change unintentionally caused side-effects from certain iterator chains combining `take`, `zip` and `next_back()` to be omitted which is observable by user code and thus likely a breaking change Technically one could declare it not a breaking change since `Zip`'s API contract is silent about about its backwards iteration behavior but on the other hand there is nothing in the stable Iterator API that could justify the currently observable behavior. And either way, this impact wasn't noticed or discussed in the original PR. Fixes rust-lang#85969
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
T-libs
Relevant to the library team, which will review and decide on the PR/issue.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
TrustedRandomAccess
requires the iterator length to fit withinusize
.take(n)
only constrains the upper bound of an iterator. So if the inner isTrustedRandomAccess
(which already implies a finite length) then so can beTake
.@rustbot label T-libs-impl