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

Add by-value iterator for arrays #62959

Merged
merged 3 commits into from Oct 25, 2019

Commits on Oct 24, 2019

  1. Add array::IntoIter as a consuming/by-value array iterator

    The iterator is implemented using const generics. It implements the
    traits `Iterator`, `DoubleEndedIterator`, `ExactSizeIterator`,
    `FusedIterator` and `TrustedLen`. It also contains a public method
    `new` to create it from an array.
    
    `IntoIterator` was not implemented for arrays yet, as there are still
    some open questions regarding backwards compatibility. This commit
    only adds the iterator impl and does not yet offer a convenient way
    to obtain that iterator.
    LukasKalbertodt committed Oct 24, 2019
    Copy the full SHA
    a2e94ca View commit details
    Browse the repository at this point in the history
  2. Add unit tests for array::IntoIter

    Many tests are based on tests by Josh Stone <cuviper@gmail.com>
    LukasKalbertodt committed Oct 24, 2019
    Copy the full SHA
    5334a30 View commit details
    Browse the repository at this point in the history
  3. Add UI tests for array::IntoIter impls

    This it to make sure traits are implemented for arrays with length 32
    and below, while they are not implemented for >= 33.
    LukasKalbertodt committed Oct 24, 2019
    Copy the full SHA
    c36b9dd View commit details
    Browse the repository at this point in the history