4
4
//!
5
5
//! *[See also the array primitive type](../../std/primitive.array.html).*
6
6
7
- #![ unstable( feature = "fixed_size_array" ,
8
- reason = "traits and impls are better expressed through generic \
9
- integer constants",
10
- issue = "27778" ) ]
7
+ #![ stable( feature = "core_array" , since = "1.36.0" ) ]
11
8
12
9
use crate :: borrow:: { Borrow , BorrowMut } ;
13
10
use crate :: cmp:: Ordering ;
@@ -30,13 +27,17 @@ use crate::slice::{Iter, IterMut};
30
27
/// Note that the traits AsRef and AsMut provide similar methods for types that
31
28
/// may not be fixed-size arrays. Implementors should prefer those traits
32
29
/// instead.
30
+ #[ unstable( feature = "fixed_size_array" , issue = "27778" ) ]
33
31
pub unsafe trait FixedSizeArray < T > {
34
32
/// Converts the array to immutable slice
33
+ #[ unstable( feature = "fixed_size_array" , issue = "27778" ) ]
35
34
fn as_slice ( & self ) -> & [ T ] ;
36
35
/// Converts the array to mutable slice
36
+ #[ unstable( feature = "fixed_size_array" , issue = "27778" ) ]
37
37
fn as_mut_slice ( & mut self ) -> & mut [ T ] ;
38
38
}
39
39
40
+ #[ unstable( feature = "fixed_size_array" , issue = "27778" ) ]
40
41
unsafe impl < T , A : Unsize < [ T ] > > FixedSizeArray < T > for A {
41
42
#[ inline]
42
43
fn as_slice ( & self ) -> & [ T ] {
@@ -53,6 +54,7 @@ unsafe impl<T, A: Unsize<[T]>> FixedSizeArray<T> for A {
53
54
#[ derive( Debug , Copy , Clone ) ]
54
55
pub struct TryFromSliceError ( ( ) ) ;
55
56
57
+ #[ stable( feature = "core_array" , since = "1.36.0" ) ]
56
58
impl fmt:: Display for TryFromSliceError {
57
59
#[ inline]
58
60
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
0 commit comments