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

ExactSizeIterator should be an unsafe trait #958

Closed
theemathas opened this issue Mar 10, 2015 · 2 comments
Closed

ExactSizeIterator should be an unsafe trait #958

theemathas opened this issue Mar 10, 2015 · 2 comments

Comments

@theemathas
Copy link

I think that ExactSizeIterator should be an unsafe trait, so that its invariant can be relied upon by unsafe code.
See also #956 and http://internals.rust-lang.org/t/the-trusted-iterator-length-problem/1302

@huonw
Copy link
Member

huonw commented Mar 10, 2015

FWIW, ExactSizeIterator doesn't help that much with size_hint (covered by the linked internals thread), since we want the guarantees to apply when a type is used as a plain Iterator generic.

@nikomatsakis
Copy link
Contributor

Closing in favor of the more general #1051.

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

3 participants