Skip to content

Commit 6d29b66

Browse files
committed
Stabilize const_slice_split_at_mut and const_slice_first_last_chunk
1 parent c39f318 commit 6d29b66

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

Diff for: library/core/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@
149149
#![feature(const_size_of_val_raw)]
150150
#![feature(const_slice_from_raw_parts_mut)]
151151
#![feature(const_slice_from_ref)]
152-
#![feature(const_slice_split_at_mut)]
153152
#![feature(const_str_as_mut)]
154153
#![feature(const_str_from_utf8_unchecked_mut)]
155154
#![feature(const_strict_overflow_ops)]

Diff for: library/core/src/slice/mod.rs

+14-7
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,8 @@ impl<T> [T] {
352352
/// ```
353353
#[inline]
354354
#[stable(feature = "slice_first_last_chunk", since = "1.77.0")]
355-
#[rustc_const_unstable(feature = "const_slice_first_last_chunk", issue = "111774")]
355+
#[rustc_const_stable(feature = "const_slice_first_last_chunk", since = "CURRENT_RUSTC_VERSION")]
356+
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
356357
pub const fn first_chunk_mut<const N: usize>(&mut self) -> Option<&mut [T; N]> {
357358
if self.len() < N {
358359
None
@@ -417,7 +418,8 @@ impl<T> [T] {
417418
/// ```
418419
#[inline]
419420
#[stable(feature = "slice_first_last_chunk", since = "1.77.0")]
420-
#[rustc_const_unstable(feature = "const_slice_first_last_chunk", issue = "111774")]
421+
#[rustc_const_stable(feature = "const_slice_first_last_chunk", since = "CURRENT_RUSTC_VERSION")]
422+
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
421423
pub const fn split_first_chunk_mut<const N: usize>(
422424
&mut self,
423425
) -> Option<(&mut [T; N], &mut [T])> {
@@ -487,7 +489,8 @@ impl<T> [T] {
487489
/// ```
488490
#[inline]
489491
#[stable(feature = "slice_first_last_chunk", since = "1.77.0")]
490-
#[rustc_const_unstable(feature = "const_slice_first_last_chunk", issue = "111774")]
492+
#[rustc_const_stable(feature = "const_slice_first_last_chunk", since = "CURRENT_RUSTC_VERSION")]
493+
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
491494
pub const fn split_last_chunk_mut<const N: usize>(
492495
&mut self,
493496
) -> Option<(&mut [T], &mut [T; N])> {
@@ -556,7 +559,8 @@ impl<T> [T] {
556559
/// ```
557560
#[inline]
558561
#[stable(feature = "slice_first_last_chunk", since = "1.77.0")]
559-
#[rustc_const_unstable(feature = "const_slice_first_last_chunk", issue = "111774")]
562+
#[rustc_const_stable(feature = "const_slice_first_last_chunk", since = "CURRENT_RUSTC_VERSION")]
563+
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
560564
pub const fn last_chunk_mut<const N: usize>(&mut self) -> Option<&mut [T; N]> {
561565
if self.len() < N {
562566
None
@@ -1899,7 +1903,8 @@ impl<T> [T] {
18991903
#[inline]
19001904
#[track_caller]
19011905
#[must_use]
1902-
#[rustc_const_unstable(feature = "const_slice_split_at_mut", issue = "101804")]
1906+
#[rustc_const_stable(feature = "const_slice_split_at_mut", since = "CURRENT_RUSTC_VERSION")]
1907+
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
19031908
pub const fn split_at_mut(&mut self, mid: usize) -> (&mut [T], &mut [T]) {
19041909
match self.split_at_mut_checked(mid) {
19051910
Some(pair) => pair,
@@ -2001,7 +2006,8 @@ impl<T> [T] {
20012006
/// assert_eq!(v, [1, 2, 3, 4, 5, 6]);
20022007
/// ```
20032008
#[stable(feature = "slice_split_at_unchecked", since = "1.79.0")]
2004-
#[rustc_const_unstable(feature = "const_slice_split_at_mut", issue = "101804")]
2009+
#[rustc_const_stable(feature = "const_slice_split_at_mut", since = "CURRENT_RUSTC_VERSION")]
2010+
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
20052011
#[inline]
20062012
#[must_use]
20072013
pub const unsafe fn split_at_mut_unchecked(&mut self, mid: usize) -> (&mut [T], &mut [T]) {
@@ -2101,7 +2107,8 @@ impl<T> [T] {
21012107
/// assert_eq!(None, v.split_at_mut_checked(7));
21022108
/// ```
21032109
#[stable(feature = "split_at_checked", since = "1.80.0")]
2104-
#[rustc_const_unstable(feature = "const_slice_split_at_mut", issue = "101804")]
2110+
#[rustc_const_stable(feature = "const_slice_split_at_mut", since = "CURRENT_RUSTC_VERSION")]
2111+
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
21052112
#[inline]
21062113
#[must_use]
21072114
pub const fn split_at_mut_checked(&mut self, mid: usize) -> Option<(&mut [T], &mut [T])> {

0 commit comments

Comments
 (0)