Skip to content

Tracking Issue for edition-dependent IntoIterator for arrays #84513

Description

@m-ou-se

Once edition 2021 is stable:

  • Update examples like this to use arrays by value. (Some(&1)Some(1) etc.)
    • Update examples to no longer avoid iterating arrays. (Many doctest examples are using iterators over e.g. &i32 instead of just i32.)
  • Remove about 200 usages of .iter().copied() and .iter().cloned() from examples and tests.

Unresolved questions:

  • Do something about the 'copying large arrays' footgun. (Add IntoIterator implementation for Box<[T; N]> etc? Add lint about big copies?)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-arrayArea: `[T; N]`A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsA-edition-2021Area: The 2021 editionA-iteratorsArea: IteratorsC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libsRelevant to the library team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions