library: Stabilize const_slice_first_last
Const-stabilizes: - `slice::first_mut` - `slice::split_first_mut` - `slice::last_mut` - `slice::split_last_mut`
This commit is contained in:
parent
75db6b29b5
commit
ac53f1f242
@ -172,7 +172,8 @@ impl<T> [T] {
|
|||||||
/// assert_eq!(None, y.first_mut());
|
/// assert_eq!(None, y.first_mut());
|
||||||
/// ```
|
/// ```
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[rustc_const_unstable(feature = "const_slice_first_last", issue = "83570")]
|
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
|
||||||
|
#[rustc_const_stable(feature = "const_slice_first_last", since = "CURRENT_RUSTC_VERSION")]
|
||||||
#[inline]
|
#[inline]
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub const fn first_mut(&mut self) -> Option<&mut T> {
|
pub const fn first_mut(&mut self) -> Option<&mut T> {
|
||||||
@ -214,7 +215,8 @@ impl<T> [T] {
|
|||||||
/// assert_eq!(x, &[3, 4, 5]);
|
/// assert_eq!(x, &[3, 4, 5]);
|
||||||
/// ```
|
/// ```
|
||||||
#[stable(feature = "slice_splits", since = "1.5.0")]
|
#[stable(feature = "slice_splits", since = "1.5.0")]
|
||||||
#[rustc_const_unstable(feature = "const_slice_first_last", issue = "83570")]
|
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
|
||||||
|
#[rustc_const_stable(feature = "const_slice_first_last", since = "CURRENT_RUSTC_VERSION")]
|
||||||
#[inline]
|
#[inline]
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub const fn split_first_mut(&mut self) -> Option<(&mut T, &mut [T])> {
|
pub const fn split_first_mut(&mut self) -> Option<(&mut T, &mut [T])> {
|
||||||
@ -256,7 +258,8 @@ impl<T> [T] {
|
|||||||
/// assert_eq!(x, &[4, 5, 3]);
|
/// assert_eq!(x, &[4, 5, 3]);
|
||||||
/// ```
|
/// ```
|
||||||
#[stable(feature = "slice_splits", since = "1.5.0")]
|
#[stable(feature = "slice_splits", since = "1.5.0")]
|
||||||
#[rustc_const_unstable(feature = "const_slice_first_last", issue = "83570")]
|
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
|
||||||
|
#[rustc_const_stable(feature = "const_slice_first_last", since = "CURRENT_RUSTC_VERSION")]
|
||||||
#[inline]
|
#[inline]
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub const fn split_last_mut(&mut self) -> Option<(&mut T, &mut [T])> {
|
pub const fn split_last_mut(&mut self) -> Option<(&mut T, &mut [T])> {
|
||||||
@ -298,7 +301,8 @@ impl<T> [T] {
|
|||||||
/// assert_eq!(None, y.last_mut());
|
/// assert_eq!(None, y.last_mut());
|
||||||
/// ```
|
/// ```
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[rustc_const_unstable(feature = "const_slice_first_last", issue = "83570")]
|
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
|
||||||
|
#[rustc_const_stable(feature = "const_slice_first_last", since = "CURRENT_RUSTC_VERSION")]
|
||||||
#[inline]
|
#[inline]
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub const fn last_mut(&mut self) -> Option<&mut T> {
|
pub const fn last_mut(&mut self) -> Option<&mut T> {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user