Skip to content

Commit 7c5cabe

Browse files
Rollup merge of #87174 - inquisitivecrystal:array-map, r=kennytm
Stabilize `[T; N]::map()` This stabilizes the `[T; N]::map()` function, gated by the `array_map` feature. The FCP has [already completed.](#75243 (comment)) Closes #75243.
2 parents effea68 + 7fc4fc7 commit 7c5cabe

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

library/core/src/array/mod.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,6 @@ impl<T, const N: usize> [T; N] {
296296
/// # Examples
297297
///
298298
/// ```
299-
/// #![feature(array_map)]
300299
/// let x = [1, 2, 3];
301300
/// let y = x.map(|v| v + 1);
302301
/// assert_eq!(y, [2, 3, 4]);
@@ -310,7 +309,7 @@ impl<T, const N: usize> [T; N] {
310309
/// let y = x.map(|v| v.len());
311310
/// assert_eq!(y, [6, 9, 3, 3]);
312311
/// ```
313-
#[unstable(feature = "array_map", issue = "75243")]
312+
#[stable(feature = "array_map", since = "1.55.0")]
314313
pub fn map<F, U>(self, f: F) -> [U; N]
315314
where
316315
F: FnMut(T) -> U,
@@ -377,7 +376,7 @@ impl<T, const N: usize> [T; N] {
377376
/// array if its elements are not `Copy`.
378377
///
379378
/// ```
380-
/// #![feature(array_methods, array_map)]
379+
/// #![feature(array_methods)]
381380
///
382381
/// let strings = ["Ferris".to_string(), "♥".to_string(), "Rust".to_string()];
383382
/// let is_ascii = strings.each_ref().map(|s| s.is_ascii());

library/core/tests/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#![feature(alloc_layout_extra)]
22
#![feature(array_chunks)]
33
#![feature(array_methods)]
4-
#![feature(array_map)]
54
#![feature(array_windows)]
65
#![feature(bool_to_option)]
76
#![feature(box_syntax)]

0 commit comments

Comments
 (0)