diff options
| author | Yuki OKUSHI <huyuumi.dev@gmail.com> | 2019-05-09 11:58:39 +0900 |
|---|---|---|
| committer | Yuki OKUSHI <huyuumi.dev@gmail.com> | 2019-05-09 12:50:55 +0900 |
| commit | 028e78d93aac664325d7ed49703032bc3ed3c185 (patch) | |
| tree | f9df1081d831aed0a87604e90985b0f3a91503eb /src/libcore/array.rs | |
| parent | 3f5152e200c0c02dfe0f79367948c98053d35855 (diff) | |
| download | rust-028e78d93aac664325d7ed49703032bc3ed3c185.tar.gz rust-028e78d93aac664325d7ed49703032bc3ed3c185.zip | |
Stabilize and re-export core::array
Diffstat (limited to 'src/libcore/array.rs')
| -rw-r--r-- | src/libcore/array.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/libcore/array.rs b/src/libcore/array.rs index fb9c99f667d..e4cadcbf75b 100644 --- a/src/libcore/array.rs +++ b/src/libcore/array.rs @@ -4,10 +4,7 @@ //! //! *[See also the array primitive type](../../std/primitive.array.html).* -#![unstable(feature = "fixed_size_array", - reason = "traits and impls are better expressed through generic \ - integer constants", - issue = "27778")] +#![stable(feature = "core_array", since = "1.36.0")] use crate::borrow::{Borrow, BorrowMut}; use crate::cmp::Ordering; @@ -30,13 +27,17 @@ use crate::slice::{Iter, IterMut}; /// Note that the traits AsRef and AsMut provide similar methods for types that /// may not be fixed-size arrays. Implementors should prefer those traits /// instead. +#[unstable(feature = "fixed_size_array", issue = "27778")] pub unsafe trait FixedSizeArray<T> { /// Converts the array to immutable slice + #[unstable(feature = "fixed_size_array", issue = "27778")] fn as_slice(&self) -> &[T]; /// Converts the array to mutable slice + #[unstable(feature = "fixed_size_array", issue = "27778")] fn as_mut_slice(&mut self) -> &mut [T]; } +#[unstable(feature = "fixed_size_array", issue = "27778")] unsafe impl<T, A: Unsize<[T]>> FixedSizeArray<T> for A { #[inline] fn as_slice(&self) -> &[T] { @@ -53,6 +54,7 @@ unsafe impl<T, A: Unsize<[T]>> FixedSizeArray<T> for A { #[derive(Debug, Copy, Clone)] pub struct TryFromSliceError(()); +#[stable(feature = "core_array", since = "1.36.0")] impl fmt::Display for TryFromSliceError { #[inline] fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { |
