about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-05-09 18:34:58 +0200
committerGitHub <noreply@github.com>2019-05-09 18:34:58 +0200
commite40f9a62bb5445767b563d888bcbfc4cd4416d38 (patch)
tree9e3f055ea50be9a3ef2bbad5dd7d1f3e18bfea2e
parent671dd0992faf936478f17dc79dcee25ea432fb53 (diff)
parent028e78d93aac664325d7ed49703032bc3ed3c185 (diff)
downloadrust-e40f9a62bb5445767b563d888bcbfc4cd4416d38.tar.gz
rust-e40f9a62bb5445767b563d888bcbfc4cd4416d38.zip
Rollup merge of #60657 - JohnTitor:stabilize-array, r=SimonSapin
Stabilize and re-export core::array in std

Fixes #60014
-rw-r--r--src/libcore/array.rs10
-rw-r--r--src/libstd/lib.rs3
2 files changed, 8 insertions, 5 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 {
diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs
index 215f1bbc971..3976f2344e2 100644
--- a/src/libstd/lib.rs
+++ b/src/libstd/lib.rs
@@ -259,7 +259,6 @@
 #![feature(exact_size_is_empty)]
 #![feature(exhaustive_patterns)]
 #![feature(external_doc)]
-#![feature(fixed_size_array)]
 #![feature(fn_traits)]
 #![feature(fnbox)]
 #![feature(generator_trait)]
@@ -435,6 +434,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;