-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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_one should put a one, not a zero (Issue #41492) #41493
Conversation
Turns out all six of these impls are incorrect.
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @sfackler (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
I haven't really been following the Step trait design, but if these impls were this broken, it seems like the level of testing of that trait is pretty lacking. |
@sfackler there are some tests in this PR, are you asking for more tests? Just trying to understand what the next steps are on this PR :) |
I am trying to understand why these methods exist if no one has noticed for so long that they return the wrong value :) |
For context, I encountered this trying to implement this proposal rust-lang/rfcs#1980 after the discussion in #28237 (comment).
I agree that the Step trait is sub-optimal, but that's already tracked by #27741. I'd propose making this fix and having the "do these methods make sense" discussion there. |
This is certainly an improvement on the status quo @bors r+ |
📌 Commit f8c6436 has been approved by |
Step::replace_one should put a one, not a zero (Issue rust-lang#41492) Turns out all six of the replace_* impls were backwards.
Step::replace_one should put a one, not a zero (Issue rust-lang#41492) Turns out all six of the replace_* impls were backwards.
Step::replace_one should put a one, not a zero (Issue rust-lang#41492) Turns out all six of the replace_* impls were backwards.
Step::replace_one should put a one, not a zero (Issue rust-lang#41492) Turns out all six of the replace_* impls were backwards.
Step::replace_one should put a one, not a zero (Issue rust-lang#41492) Turns out all six of the replace_* impls were backwards.
Step::replace_one should put a one, not a zero (Issue rust-lang#41492) Turns out all six of the replace_* impls were backwards.
Turns out all six of the replace_* impls were backwards.