-
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
Specialization for StepBy<ops::Range<T>> #108615
Comments
The PR was immediately reverted in #56049 because it was broken. It may be able to be readded if someone finds a way to fix it. |
I don't think this should be treated as a regression. |
@Nilstrieb Thank you, I missed that revert. I might pick this up in the next couple of weeks then. Should we close the issue and I open a new discussion with a PR pointing to this issue in the future? |
Keeping it open is fine, it's a suggestion for an improvement to the standard library |
This would be a welcome improvement, e.g. in #103779 I had to handroll loops because range + step_by wasn't up to snuff. rust/library/core/src/str/pattern.rs Lines 1832 to 1838 in f77bfb7
|
Closing as duplicate of #51557 |
Evidence
I remember seeing this commit that specialized StepBy for ops::Range and today when looking back at the library's source code I saw that the specialization is gone.
Here's the specialization commit merged: 95979dc
Here's the current code for StepBy::next(): https://github.com/rust-lang/rust/blob/master/library/core/src/iter/adapters/step_by.rs#L34
Why was this specialization removed and can we add it back?
The text was updated successfully, but these errors were encountered: