- [x] `array::IntoIter` type: https://github.com/rust-lang/rust/issues/65798 - [x] Idea to make `.into_iter()` resolution edition dependent: https://github.com/rust-lang/rust/issues/84133 - [x] FCP: https://github.com/rust-lang/rust/pull/84147#issuecomment-818988924 - [x] IntoIterator implementation for arrays: ~~https://github.com/rust-lang/rust/pull/65819~~ Included in https://github.com/rust-lang/rust/pull/84147 - [x] Ignore the by-value `.into_iter()` in method resolution on Rust 2015 and Rust 2018: https://github.com/rust-lang/rust/pull/84147 - [x] Update `array_into_iter` lint. - [x] Change the "might change in the future" wording: #85682 - [x] Correct wording for the current situation in the message (arrays *do* implement the trait, the method is just hiding itself in `a.into_iter()` syntax for backwards compatibility): #85682 - [x] Also suggest just removing `.into_iter()` in `for a in [1, 2, 3].into_iter()`, since that now works on all editions: #85682 - [x] Also suggest `IntoIterator::into_iter(array)`: #85682 - [x] Extend lint to also cover [this case](https://github.com/rust-lang/rust/pull/84147#issuecomment-819000436) and [this case](https://github.com/rust-lang/rust/issues/88099)? https://github.com/rust-lang/rust/pull/88512 - [x] Update documentation - [x] #87701 - [x] Point out that behaviour might be switched on 2015 and 2018 too one day - https://github.com/rust-lang/rust/pull/84590 - [x] Fix docs of `array::IntoIter::new` (the ".. in the future, after .." part): https://github.com/rust-lang/rust/pull/88610 - [x] Update docs of the `array` primitive type - https://github.com/rust-lang/rust/pull/88613 - [x] Update the book (e.g. [this section](https://doc.rust-lang.org/book/ch03-05-control-flow.html#looping-through-a-collection-with-for) and probably more, and many examples). - [x] Update standard library - [x] Remove usages of `array::IntoIter::new`: #85930 - [x] Update expressions like like `.chain(array.iter().cloned())` to just `.chain(array)` since that now works on all editions. (Same for `zip`, `extend` etc.): #85930 - [x] Use `.extend(array)` and `from_iter(array)` wherever that simplifies things. - [x] Remove `arrays do not yet implement IntoIterator` message from Iterator trait: #85670 - [x] Remove `for _ in [start..end]` messages from Iterator trait. (Could use a new clippy lint?): https://github.com/rust-lang/rust/pull/85689 - [x] Deprecate `array::IntoIter::new` (`IntoIterator::into_iter([1,2,3])` now works too on all editions.): https://github.com/rust-lang/rust/pull/88611 Once edition 2021 is stable: - [ ] Update examples like [this](https://github.com/rust-lang/rust/blob/e11a9fa52a3f372dadd6db3d3f2ed7dc2621dcc4/library/core/src/iter/traits/iterator.rs#L458-L469) 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](https://github.com/rust-lang/rust/pull/84147#issuecomment-819417230). (Add `IntoIterator` implementation for `Box<[T; N]>` etc? Add lint about big copies?)
array::IntoItertype: Tracking issue for by-value array iterator (featurearray_value_iter) #65798.into_iter()resolution edition dependent: exploration: ignoring arrays in method dispatch #84133AddIncluded in Cautiously add IntoIterator for arrays by value #84147IntoIteratorimpl for arrays by value (for [T; N]) #65819.into_iter()in method resolution on Rust 2015 and Rust 2018: Cautiously add IntoIterator for arrays by value #84147array_into_iterlint.a.into_iter()syntax for backwards compatibility): Update array_into_iter lint for 1.53 and edition changes. #85682.into_iter()infor a in [1, 2, 3].into_iter(), since that now works on all editions: Update array_into_iter lint for 1.53 and edition changes. #85682IntoIterator::into_iter(array): Update array_into_iter lint for 1.53 and edition changes. #85682array::IntoIter::new(the ".. in the future, after .." part): Update outdated docs of array::IntoIter::new. #88610arrayprimitive type - Update primitive docs for rust 2021. #88613array::IntoIter::new: Update standard library for IntoIterator implementation of arrays #85930.chain(array.iter().cloned())to just.chain(array)since that now works on all editions. (Same forzip,extendetc.): Update standard library for IntoIterator implementation of arrays #85930.extend(array)andfrom_iter(array)wherever that simplifies things.arrays do not yet implement IntoIteratormessage from Iterator trait: Remove arrays/IntoIterator message from Iterator trait. #85670for _ in [start..end]messages from Iterator trait. (Could use a new clippy lint?): Remove Iterator #[rustc_on_unimplemented]s that no longer apply. #85689array::IntoIter::new(IntoIterator::into_iter([1,2,3])now works too on all editions.): Deprecate array::IntoIter::new. #88611Once edition 2021 is stable:
Some(&1)→Some(1)etc.)&i32instead of justi32.).iter().copied()and.iter().cloned()from examples and tests.Unresolved questions:
IntoIteratorimplementation forBox<[T; N]>etc? Add lint about big copies?)