diff options
| author | Yuki OKUSHI <huyuumi.dev@gmail.com> | 2019-05-09 11:58:39 +0900 |
|---|---|---|
| committer | Pietro Albini <pietro@pietroalbini.org> | 2019-05-14 22:45:26 +0200 |
| commit | 08aff9fe3a769fdd7959856e956340fc8de30b15 (patch) | |
| tree | dc1764ef486926618b80e8b6327d90972f2dc1f3 | |
| parent | 1486e1fb4bfa72f5a752c18ebf210de4194e04d0 (diff) | |
| download | rust-08aff9fe3a769fdd7959856e956340fc8de30b15.tar.gz rust-08aff9fe3a769fdd7959856e956340fc8de30b15.zip | |
Stabilize and re-export core::array
| -rw-r--r-- | src/libcore/array.rs | 10 | ||||
| -rw-r--r-- | src/libstd/lib.rs | 3 |
2 files changed, 8 insertions, 5 deletions
diff --git a/src/libcore/array.rs b/src/libcore/array.rs index dcd9ce6dad7..96cb2c5ade2 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 borrow::{Borrow, BorrowMut}; use cmp::Ordering; @@ -30,13 +27,17 @@ use 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 { diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index d11dee8fc97..8935245b34e 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -260,7 +260,6 @@ #![feature(exact_size_is_empty)] #![feature(exhaustive_patterns)] #![feature(external_doc)] -#![feature(fixed_size_array)] #![feature(fn_traits)] #![feature(fnbox)] #![feature(futures_api)] @@ -436,6 +435,8 @@ pub use core::char; pub use core::u128; #[stable(feature = "core_hint", since = "1.27.0")] pub use core::hint; +#[stable(feature = "core_array", since = "1.36.0")] +pub use core::array; pub mod f32; pub mod f64; |
