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

remove InPlaceIterable marker from Peekable due to unsoundness #85340

Merged
merged 3 commits into from
May 20, 2021

Commits on May 18, 2021

  1. remove InPlaceIterable marker from Peekable due to unsoundness

    The unsoundness is not in Peekable per se, it rather is due to the
    interaction between Peekable being able to hold an extra item
    and vec::IntoIter's clone implementation shortening the allocation.
    
    An alternative solution would be to change IntoIter's clone implementation
    to keep enough spare capacity available.
    the8472 committed May 18, 2021
    Configuration menu
    Copy the full SHA
    60a900e View commit details
    Browse the repository at this point in the history
  2. add regression test

    the8472 committed May 18, 2021
    Configuration menu
    Copy the full SHA
    a44a059 View commit details
    Browse the repository at this point in the history
  3. from review: more robust test

    This also checks the contents and not only the capacity in case IntoIter's clone implementation is changed to add capacity at the end. Extra capacity at the beginning would be needed to make InPlaceIterable work.
    
    Co-authored-by: Giacomo Stevanato <giaco.stevanato@gmail.com>
    the8472 and SkiFire13 committed May 18, 2021
    Configuration menu
    Copy the full SHA
    7cb4e51 View commit details
    Browse the repository at this point in the history