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

Comments

Projects
None yet
3 participants
@theemathas
Copy link

theemathas commented Mar 10, 2015

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Contributor

nikomatsakis commented Apr 9, 2015

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
You can’t perform that action at this time.