Skip to content

Commit 08aff9f

Browse files
JohnTitorpietroalbini
authored andcommitted
Stabilize and re-export core::array
1 parent 1486e1f commit 08aff9f

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/libcore/array.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44
//!
55
//! *[See also the array primitive type](../../std/primitive.array.html).*
66
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")]
118

129
use borrow::{Borrow, BorrowMut};
1310
use cmp::Ordering;
@@ -30,13 +27,17 @@ use slice::{Iter, IterMut};
3027
/// Note that the traits AsRef and AsMut provide similar methods for types that
3128
/// may not be fixed-size arrays. Implementors should prefer those traits
3229
/// instead.
30+
#[unstable(feature = "fixed_size_array", issue = "27778")]
3331
pub unsafe trait FixedSizeArray<T> {
3432
/// Converts the array to immutable slice
33+
#[unstable(feature = "fixed_size_array", issue = "27778")]
3534
fn as_slice(&self) -> &[T];
3635
/// Converts the array to mutable slice
36+
#[unstable(feature = "fixed_size_array", issue = "27778")]
3737
fn as_mut_slice(&mut self) -> &mut [T];
3838
}
3939

40+
#[unstable(feature = "fixed_size_array", issue = "27778")]
4041
unsafe impl<T, A: Unsize<[T]>> FixedSizeArray<T> for A {
4142
#[inline]
4243
fn as_slice(&self) -> &[T] {
@@ -53,6 +54,7 @@ unsafe impl<T, A: Unsize<[T]>> FixedSizeArray<T> for A {
5354
#[derive(Debug, Copy, Clone)]
5455
pub struct TryFromSliceError(());
5556

57+
#[stable(feature = "core_array", since = "1.36.0")]
5658
impl fmt::Display for TryFromSliceError {
5759
#[inline]
5860
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {

src/libstd/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,6 @@
260260
#![feature(exact_size_is_empty)]
261261
#![feature(exhaustive_patterns)]
262262
#![feature(external_doc)]
263-
#![feature(fixed_size_array)]
264263
#![feature(fn_traits)]
265264
#![feature(fnbox)]
266265
#![feature(futures_api)]
@@ -436,6 +435,8 @@ pub use core::char;
436435
pub use core::u128;
437436
#[stable(feature = "core_hint", since = "1.27.0")]
438437
pub use core::hint;
438+
#[stable(feature = "core_array", since = "1.36.0")]
439+
pub use core::array;
439440

440441
pub mod f32;
441442
pub mod f64;

0 commit comments

Comments
 (0)