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

Increment self.index before calling `Iterator::self.a.__iterator_ge… #81741

Commits on Feb 4, 2021

  1. Increment self.index before calling `Iterator::self.a.__iterator_ge…

    …t_unchecked` in `Zip` `TrustedRandomAccess` specialization
    
    Otherwise if `Iterator::self.a.__iterator_get_unchecked` panics the
    index would not have been incremented yet and another call to
    `Iterator::next` would read from the same index again, which is not
    allowed according to the API contract of `TrustedRandomAccess` for
    `!Clone`.
    
    Fixes rust-lang#81740
    sdroege committed Feb 4, 2021
    Configuration menu
    Copy the full SHA
    86a4b27 View commit details
    Browse the repository at this point in the history