Skip to content

Commit 911ee94

Browse files
committed
Deprecate array::IntoIter::new.
1 parent efec545 commit 911ee94

File tree

1 file changed

+1
-20
lines changed

1 file changed

+1
-20
lines changed

library/core/src/array/iter.rs

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -36,27 +36,8 @@ pub struct IntoIter<T, const N: usize> {
3636

3737
impl<T, const N: usize> IntoIter<T, N> {
3838
/// Creates a new iterator over the given `array`.
39-
///
40-
/// *Note*: this method might be deprecated in the future,
41-
/// since [`IntoIterator`] is now implemented for arrays.
42-
///
43-
/// # Examples
44-
///
45-
/// ```
46-
/// use std::array;
47-
///
48-
/// for value in array::IntoIter::new([1, 2, 3, 4, 5]) {
49-
/// // The type of `value` is an `i32` here, instead of `&i32`
50-
/// let _: i32 = value;
51-
/// }
52-
///
53-
/// // Since Rust 1.53, arrays implement IntoIterator directly:
54-
/// for value in [1, 2, 3, 4, 5] {
55-
/// // The type of `value` is an `i32` here, instead of `&i32`
56-
/// let _: i32 = value;
57-
/// }
58-
/// ```
5939
#[stable(feature = "array_value_iter", since = "1.51.0")]
40+
#[rustc_deprecated(since = "1.57.0", reason = "use `IntoIterator::into_iter` instead")]
6041
pub fn new(array: [T; N]) -> Self {
6142
// SAFETY: The transmute here is actually safe. The docs of `MaybeUninit`
6243
// promise:

0 commit comments

Comments
 (0)