Skip to content
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

Delete deprecated & unstable range-specific step_by #43012

Merged
merged 1 commit into from
Jul 4, 2017

Conversation

scottmcm
Copy link
Member

@scottmcm scottmcm commented Jul 2, 2017

Using the new one is annoying while this one exists, since the inherent method hides the one on iterator.

Tracking issue: #27741
Replacement: #41439
Deprecation: #42310 for 1.19
Fixes #41477

Replacement: 41439
Deprecation: 42310 for 1.19
Fixes 41477
@rust-highfive
Copy link
Collaborator

r? @brson

(rust_highfive has picked a reviewer for you, use r? to override)

@brson
Copy link
Contributor

brson commented Jul 4, 2017

r? @alexcrichton

@rust-highfive rust-highfive assigned alexcrichton and unassigned brson Jul 4, 2017
@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Jul 4, 2017

📌 Commit dcd332e has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented Jul 4, 2017

⌛ Testing commit dcd332e with merge 7a75d2b...

bors added a commit that referenced this pull request Jul 4, 2017
Delete deprecated & unstable range-specific `step_by`

Using the new one is annoying while this one exists, since the inherent method hides the one on iterator.

Tracking issue: #27741
Replacement: #41439
Deprecation: #42310 for 1.19
Fixes #41477
@bors
Copy link
Contributor

bors commented Jul 4, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: alexcrichton
Pushing 7a75d2b to master...

@leonardo-m
Copy link

leonardo-m commented Jul 5, 2017

See also #43063 and #43064

@SimonSapin
Copy link
Contributor

This is blocking Servo from upgrading Rust until we find a work around :/ Iterator:step_by is not a full replacement since it cannot support negative steps, and .rev() produces a different type. We have code that conditionally returns an iterator with positive or negative step.

@SimonSapin
Copy link
Contributor

This was pointed out in #27741 (comment) when Range::step_by was deprecated.

SimonSapin added a commit to servo/servo that referenced this pull request Jul 5, 2017
@SimonSapin
Copy link
Contributor

I ended up making this type. Would something like it belong in std?

struct MaybeReverse<I> {
    iter: I,
    reverse: bool,
}

impl<I: DoubleEndedIterator> Iterator for MaybeReverse<I> {
    type Item = I::Item;

    fn next(&mut self) -> Option<I::Item> {
        if self.reverse {
            self.iter.next_back()
        } else {
            self.iter.next()
        }
    }
}

bors-servo pushed a commit to servo/servo that referenced this pull request Jul 5, 2017
Replace remaining usage of deprecated Range::step_by

… which is being removed in rust-lang/rust#43012

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17605)
<!-- Reviewable:end -->
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Jul 6, 2017
…ep_by (from servo:maybereverse); r=nox

… which is being removed in rust-lang/rust#43012

Source-Repo: https://github.com/servo/servo
Source-Revision: 5baea7b73223283b551cf378bb714491a2383c28

--HG--
extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear
extra : subtree_revision : bf5a743b537b8b238e83e8c84c69ce98e15ec410
weilonge pushed a commit to fx-dev-playground/gecko that referenced this pull request Jul 6, 2017
…ep_by (from servo:maybereverse); r=nox

… which is being removed in rust-lang/rust#43012

Source-Repo: https://github.com/servo/servo
Source-Revision: 5baea7b73223283b551cf378bb714491a2383c28
bors added a commit that referenced this pull request Jul 8, 2017
Implement O(1)-time Iterator::nth for Range*, and slim the Step trait

Fixes #43064.
Fixes part of #39975.
Fixes items 1 <s>and 3</s> of #42168.
CC #27741.

I think #42310 and #43012 should not have landed without the `nth` part of this PR, but oh well.
JerryShih pushed a commit to JerryShih/gecko-dev that referenced this pull request Jul 10, 2017
…ep_by (from servo:maybereverse); r=nox

… which is being removed in rust-lang/rust#43012

Source-Repo: https://github.com/servo/servo
Source-Revision: 5baea7b73223283b551cf378bb714491a2383c28
Manishearth pushed a commit to Manishearth/gecko-dev that referenced this pull request Jul 10, 2017
…ep_by (from servo:maybereverse); r=nox

… which is being removed in rust-lang/rust#43012

Source-Repo: https://github.com/servo/servo
Source-Revision: 5baea7b73223283b551cf378bb714491a2383c28
aethanyc pushed a commit to aethanyc/gecko-dev that referenced this pull request Jul 11, 2017
…ep_by (from servo:maybereverse); r=nox

… which is being removed in rust-lang/rust#43012

Source-Repo: https://github.com/servo/servo
Source-Revision: 5baea7b73223283b551cf378bb714491a2383c28
@scottmcm scottmcm deleted the delete-range-step-by branch July 15, 2017 07:40
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Oct 1, 2019
…ep_by (from servo:maybereverse); r=nox

… which is being removed in rust-lang/rust#43012

Source-Repo: https://github.com/servo/servo
Source-Revision: 5baea7b73223283b551cf378bb714491a2383c28

UltraBlame original commit: 2828efca932c62b6412d361437ee058577f551ac
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Oct 1, 2019
…ep_by (from servo:maybereverse); r=nox

… which is being removed in rust-lang/rust#43012

Source-Repo: https://github.com/servo/servo
Source-Revision: 5baea7b73223283b551cf378bb714491a2383c28

UltraBlame original commit: 2828efca932c62b6412d361437ee058577f551ac
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Oct 1, 2019
…ep_by (from servo:maybereverse); r=nox

… which is being removed in rust-lang/rust#43012

Source-Repo: https://github.com/servo/servo
Source-Revision: 5baea7b73223283b551cf378bb714491a2383c28

UltraBlame original commit: 2828efca932c62b6412d361437ee058577f551ac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants