diff options
| author | Josh Stone <jistone@redhat.com> | 2021-04-14 12:05:56 -0700 |
|---|---|---|
| committer | Josh Stone <jistone@redhat.com> | 2021-04-16 11:12:01 -0700 |
| commit | c020367b820b982a3c0ac86cedc5be6ed732b2fe (patch) | |
| tree | b611c1d022ec3300802d6f9c6ec845e960f4e78c /library/core/src/array | |
| parent | 4d089a41b1faec8b9d4f2a6cc3efcef72eb2d6fe (diff) | |
| download | rust-c020367b820b982a3c0ac86cedc5be6ed732b2fe.tar.gz rust-c020367b820b982a3c0ac86cedc5be6ed732b2fe.zip | |
Document the edition behavior for array.into_iter()
Diffstat (limited to 'library/core/src/array')
| -rw-r--r-- | library/core/src/array/mod.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/library/core/src/array/mod.rs b/library/core/src/array/mod.rs index ddbdc6a4acf..d4e71f4ef75 100644 --- a/library/core/src/array/mod.rs +++ b/library/core/src/array/mod.rs @@ -164,6 +164,14 @@ impl<T, const N: usize> IntoIterator for [T; N] { type Item = T; type IntoIter = IntoIter<T, N>; + /// Creates a consuming iterator, that is, one that moves each value out of + /// the array (from start to end). The array cannot be used after calling + /// this unless `T` implements `Copy`, so the whole array is copied. + /// + /// Arrays have special behavior when calling `.into_iter()` prior to the + /// 2021 edition -- see the [array] Editions section for more information. + /// + /// [array]: prim@array fn into_iter(self) -> Self::IntoIter { IntoIter::new(self) } |
