From c020367b820b982a3c0ac86cedc5be6ed732b2fe Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 14 Apr 2021 12:05:56 -0700 Subject: Document the edition behavior for array.into_iter() --- library/core/src/array/mod.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'library/core/src/array') 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 IntoIterator for [T; N] { type Item = T; type IntoIter = IntoIter; + /// 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) } -- cgit 1.4.1-3-g733a5