about summary refs log tree commit diff
path: root/library/core/src/array
diff options
context:
space:
mode:
authorMara Bos <m-ou.se@m-ou.se>2021-09-03 11:31:09 +0200
committerMara Bos <m-ou.se@m-ou.se>2021-12-04 19:15:44 +0100
commit911ee9403e1778ebac01b5f2d45ab9d960d5da4a (patch)
treeb0a09de83e61f381eb67bb086c847e3d7ab9ee20 /library/core/src/array
parentefec545293b9263be9edfb283a7aa66350b3acbf (diff)
downloadrust-911ee9403e1778ebac01b5f2d45ab9d960d5da4a.tar.gz
rust-911ee9403e1778ebac01b5f2d45ab9d960d5da4a.zip
Deprecate array::IntoIter::new.
Diffstat (limited to 'library/core/src/array')
-rw-r--r--library/core/src/array/iter.rs21
1 files changed, 1 insertions, 20 deletions
diff --git a/library/core/src/array/iter.rs b/library/core/src/array/iter.rs
index 5d63cf03fcb..80ba1c95a1d 100644
--- a/library/core/src/array/iter.rs
+++ b/library/core/src/array/iter.rs
@@ -36,27 +36,8 @@ pub struct IntoIter<T, const N: usize> {
 
 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,
-    /// since [`IntoIterator`] is now implemented for arrays.
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use std::array;
-    ///
-    /// for value in array::IntoIter::new([1, 2, 3, 4, 5]) {
-    ///     // 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;
-    /// }
-    /// ```
     #[stable(feature = "array_value_iter", since = "1.51.0")]
+    #[rustc_deprecated(since = "1.57.0", reason = "use `IntoIterator::into_iter` instead")]
     pub fn new(array: [T; N]) -> Self {
         // SAFETY: The transmute here is actually safe. The docs of `MaybeUninit`
         // promise: