Skip to content

Commit dc1a19f

Browse files
committed
stabilise array methods
1 parent 525a17e commit dc1a19f

File tree

3 files changed

+2
-9
lines changed

3 files changed

+2
-9
lines changed

alloc/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@
9292
#![feature(allocator_api)]
9393
#![feature(array_chunks)]
9494
#![feature(array_into_iter_constructors)]
95-
#![feature(array_methods)]
9695
#![feature(array_windows)]
9796
#![feature(assert_matches)]
9897
#![feature(async_iterator)]

core/src/array/mod.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -592,8 +592,6 @@ impl<T, const N: usize> [T; N] {
592592
/// # Example
593593
///
594594
/// ```
595-
/// #![feature(array_methods)]
596-
///
597595
/// let floats = [3.1, 2.7, -1.0];
598596
/// let float_refs: [&f64; 3] = floats.each_ref();
599597
/// assert_eq!(float_refs, [&3.1, &2.7, &-1.0]);
@@ -604,16 +602,14 @@ impl<T, const N: usize> [T; N] {
604602
/// array if its elements are not [`Copy`].
605603
///
606604
/// ```
607-
/// #![feature(array_methods)]
608-
///
609605
/// let strings = ["Ferris".to_string(), "♥".to_string(), "Rust".to_string()];
610606
/// let is_ascii = strings.each_ref().map(|s| s.is_ascii());
611607
/// assert_eq!(is_ascii, [true, false, true]);
612608
///
613609
/// // We can still access the original array: it has not been moved.
614610
/// assert_eq!(strings.len(), 3);
615611
/// ```
616-
#[unstable(feature = "array_methods", issue = "76118")]
612+
#[stable(feature = "array_methods", since = "CURRENT_RUSTC_VERSION")]
617613
pub fn each_ref(&self) -> [&T; N] {
618614
// SAFETY: we know for certain that this iterator will yield exactly `N`
619615
// items.
@@ -627,15 +623,14 @@ impl<T, const N: usize> [T; N] {
627623
/// # Example
628624
///
629625
/// ```
630-
/// #![feature(array_methods)]
631626
///
632627
/// let mut floats = [3.1, 2.7, -1.0];
633628
/// let float_refs: [&mut f64; 3] = floats.each_mut();
634629
/// *float_refs[0] = 0.0;
635630
/// assert_eq!(float_refs, [&mut 0.0, &mut 2.7, &mut -1.0]);
636631
/// assert_eq!(floats, [0.0, 2.7, -1.0]);
637632
/// ```
638-
#[unstable(feature = "array_methods", issue = "76118")]
633+
#[stable(feature = "array_methods", since = "CURRENT_RUSTC_VERSION")]
639634
pub fn each_mut(&mut self) -> [&mut T; N] {
640635
// SAFETY: we know for certain that this iterator will yield exactly `N`
641636
// items.

core/tests/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![feature(alloc_layout_extra)]
22
#![feature(array_chunks)]
3-
#![feature(array_methods)]
43
#![feature(array_windows)]
54
#![feature(bigint_helper_methods)]
65
#![feature(cell_update)]

0 commit comments

Comments
 (0)