Skip to content

Commit f38f442

Browse files
committed
Stabilise 'as_array' in '[_]' and '*const [_]'; Stabilise 'as_mut_array' in '[_]' and '*mut [_]';
1 parent 0b278a5 commit f38f442

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-6
lines changed

compiler/rustc_codegen_llvm/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
77
// tidy-alphabetical-start
88
#![allow(internal_features)]
9+
#![cfg_attr(bootstrap, feature(slice_as_array))]
910
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
1011
#![doc(rust_logo)]
1112
#![feature(assert_matches)]
@@ -16,7 +17,6 @@
1617
#![feature(iter_intersperse)]
1718
#![feature(macro_derive)]
1819
#![feature(rustdoc_internals)]
19-
#![feature(slice_as_array)]
2020
#![feature(try_blocks)]
2121
// tidy-alphabetical-end
2222

library/core/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@
119119
#![feature(ptr_alignment_type)]
120120
#![feature(ptr_metadata)]
121121
#![feature(set_ptr_value)]
122-
#![feature(slice_as_array)]
123122
#![feature(slice_ptr_get)]
124123
#![feature(str_internals)]
125124
#![feature(str_split_inclusive_remainder)]

library/core/src/ptr/const_ptr.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1462,7 +1462,8 @@ impl<T> *const [T] {
14621462
/// Gets a raw pointer to the underlying array.
14631463
///
14641464
/// If `N` is not exactly equal to the length of `self`, then this method returns `None`.
1465-
#[unstable(feature = "slice_as_array", issue = "133508")]
1465+
#[stable(feature = "core_slice_as_array", since = "CURRENT_RUSTC_VERSION")]
1466+
#[rustc_const_stable(feature = "core_slice_as_array", since = "CURRENT_RUSTC_VERSION")]
14661467
#[inline]
14671468
#[must_use]
14681469
pub const fn as_array<const N: usize>(self) -> Option<*const [T; N]> {

library/core/src/ptr/mut_ptr.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1708,7 +1708,8 @@ impl<T> *mut [T] {
17081708
/// Gets a raw, mutable pointer to the underlying array.
17091709
///
17101710
/// If `N` is not exactly equal to the length of `self`, then this method returns `None`.
1711-
#[unstable(feature = "slice_as_array", issue = "133508")]
1711+
#[stable(feature = "core_slice_as_array", since = "CURRENT_RUSTC_VERSION")]
1712+
#[rustc_const_stable(feature = "core_slice_as_array", since = "CURRENT_RUSTC_VERSION")]
17121713
#[inline]
17131714
#[must_use]
17141715
pub const fn as_mut_array<const N: usize>(self) -> Option<*mut [T; N]> {

library/core/src/slice/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,8 @@ impl<T> [T] {
841841
/// Gets a reference to the underlying array.
842842
///
843843
/// If `N` is not exactly equal to the length of `self`, then this method returns `None`.
844-
#[unstable(feature = "slice_as_array", issue = "133508")]
844+
#[stable(feature = "core_slice_as_array", since = "CURRENT_RUSTC_VERSION")]
845+
#[rustc_const_stable(feature = "core_slice_as_array", since = "CURRENT_RUSTC_VERSION")]
845846
#[inline]
846847
#[must_use]
847848
pub const fn as_array<const N: usize>(&self) -> Option<&[T; N]> {
@@ -859,7 +860,8 @@ impl<T> [T] {
859860
/// Gets a mutable reference to the slice's underlying array.
860861
///
861862
/// If `N` is not exactly equal to the length of `self`, then this method returns `None`.
862-
#[unstable(feature = "slice_as_array", issue = "133508")]
863+
#[stable(feature = "core_slice_as_array", since = "CURRENT_RUSTC_VERSION")]
864+
#[rustc_const_stable(feature = "core_slice_as_array", since = "CURRENT_RUSTC_VERSION")]
863865
#[inline]
864866
#[must_use]
865867
pub const fn as_mut_array<const N: usize>(&mut self) -> Option<&mut [T; N]> {

0 commit comments

Comments
 (0)