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

Documentation for ExactSizeIterator does not make clear that len() should change with iteration #98721

Closed
alice-i-cecile opened this issue Jun 30, 2022 · 1 comment · Fixed by #98729
Assignees
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools

Comments

@alice-i-cecile
Copy link

Reading between the lines on ExactSizeIterator (and investigating other implementations), it appears that the value of the returned len() should change as iteration occurs.

This is very subtle, and was missed by our entire team, see bevyengine/bevy#5149.

This information should be discussed prominently in the docs.

@Rageking8
Copy link
Contributor

@rustbot label A-docs

@rustbot rustbot added the A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools label Jun 30, 2022
@the8472 the8472 self-assigned this Jun 30, 2022
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jun 30, 2022
clarify that ExactSizeIterator::len returns the remaining length

fixes rust-lang#98721
@bors bors closed this as completed in 734f21c Jul 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants