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

Step::replace_zero actually replaces it with one #41492

Closed
scottmcm opened this issue Apr 24, 2017 · 2 comments
Closed

Step::replace_zero actually replaces it with one #41492

scottmcm opened this issue Apr 24, 2017 · 2 comments

Comments

@scottmcm
Copy link
Member

Repro (nightly 2017-04-22):

#![feature(step_trait)]
use std::iter::Step;
fn main() {
    let mut x = 3;
    x.replace_zero();
    assert_eq!(x, 0);
}

Actual:

assertion failed: `(left == right)` (left: `1`, right: `0`)
scottmcm added a commit to scottmcm/rust that referenced this issue Apr 24, 2017
Turns out all six of these impls are incorrect.
@scottmcm
Copy link
Member Author

PR #41493

arielb1 pushed a commit to arielb1/rust that referenced this issue Apr 25, 2017
Step::replace_one should put a one, not a zero (Issue rust-lang#41492)

Turns out all six of the replace_* impls were backwards.
arielb1 pushed a commit to arielb1/rust that referenced this issue Apr 25, 2017
Step::replace_one should put a one, not a zero (Issue rust-lang#41492)

Turns out all six of the replace_* impls were backwards.
frewsxcv added a commit to frewsxcv/rust that referenced this issue Apr 26, 2017
Step::replace_one should put a one, not a zero (Issue rust-lang#41492)

Turns out all six of the replace_* impls were backwards.
frewsxcv added a commit to frewsxcv/rust that referenced this issue Apr 26, 2017
Step::replace_one should put a one, not a zero (Issue rust-lang#41492)

Turns out all six of the replace_* impls were backwards.
arielb1 pushed a commit to arielb1/rust that referenced this issue Apr 26, 2017
Step::replace_one should put a one, not a zero (Issue rust-lang#41492)

Turns out all six of the replace_* impls were backwards.
arielb1 pushed a commit to arielb1/rust that referenced this issue Apr 26, 2017
Step::replace_one should put a one, not a zero (Issue rust-lang#41492)

Turns out all six of the replace_* impls were backwards.
@scottmcm
Copy link
Member Author

Passes on nightly (94e884b 2017-04-27)

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

No branches or pull requests

1 participant