Uh oh!
There was an error while loading. Please reload this page.
implement TrustedRandomAccess for Take iterator adapter - #83990
Merged
Conversation
rust-highfive
commented
Apr 8, 2021
Contributor
r? @kennytm (rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
dtolnay
commented
Apr 21, 2021
Member
@bors r+ |
bors
commented
Apr 21, 2021
Collaborator
📌 Commit 37a5b51 has been approved by |
bors
commented
Apr 21, 2021
Collaborator
🌲 The tree is currently closed for pull requests below priority 1000. This pull request will be tested once the tree is reopened. |
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
bors
commented
Apr 24, 2021
Collaborator
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. Fixesrust-lang#85969
This file contains hidden or 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
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
TrustedRandomAccessrequires 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