@@ -31,14 +31,12 @@ pub use iter::IntoIter;
31
31
/// # Example
32
32
///
33
33
/// ```rust
34
- /// #![feature(array_from_fn)]
35
- ///
36
34
/// let array = core::array::from_fn(|i| i);
37
35
/// assert_eq!(array, [0, 1, 2, 3, 4]);
38
36
/// ```
39
37
#[ inline]
40
- #[ unstable ( feature = "array_from_fn" , issue = "89379 " ) ]
41
- pub fn from_fn < F , T , const N : usize > ( mut cb : F ) -> [ T ; N ]
38
+ #[ stable ( feature = "array_from_fn" , since = "1.63.0 " ) ]
39
+ pub fn from_fn < T , const N : usize , F > ( mut cb : F ) -> [ T ; N ]
42
40
where
43
41
F : FnMut ( usize ) -> T ,
44
42
{
65
63
/// # Example
66
64
///
67
65
/// ```rust
68
- /// #![feature(array_from_fn )]
66
+ /// #![feature(array_try_from_fn )]
69
67
///
70
68
/// let array: Result<[u8; 5], _> = std::array::try_from_fn(|i| i.try_into());
71
69
/// assert_eq!(array, Ok([0, 1, 2, 3, 4]));
80
78
/// assert_eq!(array, None);
81
79
/// ```
82
80
#[ inline]
83
- #[ unstable( feature = "array_from_fn " , issue = "89379" ) ]
84
- pub fn try_from_fn < F , R , const N : usize > ( cb : F ) -> ChangeOutputType < R , [ R :: Output ; N ] >
81
+ #[ unstable( feature = "array_try_from_fn " , issue = "89379" ) ]
82
+ pub fn try_from_fn < R , const N : usize , F > ( cb : F ) -> ChangeOutputType < R , [ R :: Output ; N ] >
85
83
where
86
84
F : FnMut ( usize ) -> R ,
87
85
R : Try ,
0 commit comments