Skip to content

Commit 5ea45f3

Browse files
committed
Update outdated docs of array::IntoIter::new.
1 parent fbdff7f commit 5ea45f3

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

library/core/src/array/iter.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ impl<T, const N: usize> IntoIter<T, N> {
3737
/// Creates a new iterator over the given `array`.
3838
///
3939
/// *Note*: this method might be deprecated in the future,
40-
/// after [`IntoIterator` is implemented for arrays][array-into-iter].
40+
/// since [`IntoIterator`] is now implemented for arrays.
4141
///
4242
/// # Examples
4343
///
@@ -48,8 +48,13 @@ impl<T, const N: usize> IntoIter<T, N> {
4848
/// // The type of `value` is an `i32` here, instead of `&i32`
4949
/// let _: i32 = value;
5050
/// }
51+
///
52+
/// // Since Rust 1.53, arrays implement IntoIterator directly:
53+
/// for value in [1, 2, 3, 4, 5] {
54+
/// // The type of `value` is an `i32` here, instead of `&i32`
55+
/// let _: i32 = value;
56+
/// }
5157
/// ```
52-
/// [array-into-iter]: https://github.com/rust-lang/rust/pull/65819
5358
#[stable(feature = "array_value_iter", since = "1.51.0")]
5459
pub fn new(array: [T; N]) -> Self {
5560
// SAFETY: The transmute here is actually safe. The docs of `MaybeUninit`

0 commit comments

Comments
 (0)