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

ToPrimitive bound on Iterator impl for Range and related traits. #13

Open
alercah opened this issue Dec 3, 2019 · 2 comments
Open

ToPrimitive bound on Iterator impl for Range and related traits. #13

alercah opened this issue Dec 3, 2019 · 2 comments

Comments

@alercah
Copy link

alercah commented Dec 3, 2019

See this line which references rust-lang/rust#10414, now closed. The modern Range trait in the stdlib uses an unstable Step trait to generate its size_hint; perhaps something similar would work for this crate?

@cuviper
Copy link
Member

cuviper commented Dec 3, 2019

Well, core can get away with that because they only support iterating Range with the primitive integer types, which can privately implement Step. For num-iter, we would need a public (stable) trait that external users can implement to make this Range work for their types.

@alercah
Copy link
Author

alercah commented Dec 3, 2019

Yes, agreed, it would need to be stable. But that seems more flexible than requiring ToPrimitive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants