about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMara Bos <m-ou.se@m-ou.se>2021-09-03 13:30:50 +0200
committerGitHub <noreply@github.com>2021-09-03 13:30:50 +0200
commite13b9c90c9b797210e85130b8aa9c8bd4370cc3b (patch)
tree0a8aefb5862a0bdb01af0042a514f02e0e6ff774
parent01775b60279e543c34d45800606033a51bbd7a57 (diff)
parent5ea45f35c07ff8a52483ecdd697e9d23fdf53666 (diff)
downloadrust-e13b9c90c9b797210e85130b8aa9c8bd4370cc3b.tar.gz
rust-e13b9c90c9b797210e85130b8aa9c8bd4370cc3b.zip
Rollup merge of #88610 - m-ou-se:array-into-iter-docs, r=Amanieu
Update outdated docs of array::IntoIter::new.
-rw-r--r--library/core/src/array/iter.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/library/core/src/array/iter.rs b/library/core/src/array/iter.rs
index 77c52e51abb..ecdbf098819 100644
--- a/library/core/src/array/iter.rs
+++ b/library/core/src/array/iter.rs
@@ -37,7 +37,7 @@ impl<T, const N: usize> IntoIter<T, N> {
     /// Creates a new iterator over the given `array`.
     ///
     /// *Note*: this method might be deprecated in the future,
-    /// after [`IntoIterator` is implemented for arrays][array-into-iter].
+    /// since [`IntoIterator`] is now implemented for arrays.
     ///
     /// # Examples
     ///
@@ -48,8 +48,13 @@ impl<T, const N: usize> IntoIter<T, N> {
     ///     // The type of `value` is an `i32` here, instead of `&i32`
     ///     let _: i32 = value;
     /// }
+    ///
+    /// // Since Rust 1.53, arrays implement IntoIterator directly:
+    /// for value in [1, 2, 3, 4, 5] {
+    ///     // The type of `value` is an `i32` here, instead of `&i32`
+    ///     let _: i32 = value;
+    /// }
     /// ```
-    /// [array-into-iter]: https://github.com/rust-lang/rust/pull/65819
     #[stable(feature = "array_value_iter", since = "1.51.0")]
     pub fn new(array: [T; N]) -> Self {
         // SAFETY: The transmute here is actually safe. The docs of `MaybeUninit`