Skip to content

Commit

Permalink
Update const_slice_first_last_not_mut stable version.
Browse files Browse the repository at this point in the history
  • Loading branch information
m-ou-se committed Aug 1, 2021
1 parent 5d85130 commit 9854d30
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions library/core/src/slice/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ impl<T> [T] {
/// assert_eq!(None, w.first());
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(feature = "const_slice_first_last_not_mut", since = "1.55.0")]
#[rustc_const_stable(feature = "const_slice_first_last_not_mut", since = "1.56.0")]
#[inline]
pub const fn first(&self) -> Option<&T> {
if let [first, ..] = self { Some(first) } else { None }
Expand Down Expand Up @@ -178,7 +178,7 @@ impl<T> [T] {
/// }
/// ```
#[stable(feature = "slice_splits", since = "1.5.0")]
#[rustc_const_stable(feature = "const_slice_first_last_not_mut", since = "1.55.0")]
#[rustc_const_stable(feature = "const_slice_first_last_not_mut", since = "1.56.0")]
#[inline]
pub const fn split_first(&self) -> Option<(&T, &[T])> {
if let [first, tail @ ..] = self { Some((first, tail)) } else { None }
Expand Down Expand Up @@ -218,7 +218,7 @@ impl<T> [T] {
/// }
/// ```
#[stable(feature = "slice_splits", since = "1.5.0")]
#[rustc_const_stable(feature = "const_slice_first_last_not_mut", since = "1.55.0")]
#[rustc_const_stable(feature = "const_slice_first_last_not_mut", since = "1.56.0")]
#[inline]
pub const fn split_last(&self) -> Option<(&T, &[T])> {
if let [init @ .., last] = self { Some((last, init)) } else { None }
Expand Down Expand Up @@ -257,7 +257,7 @@ impl<T> [T] {
/// assert_eq!(None, w.last());
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(feature = "const_slice_first_last_not_mut", since = "1.55.0")]
#[rustc_const_stable(feature = "const_slice_first_last_not_mut", since = "1.56.0")]
#[inline]
pub const fn last(&self) -> Option<&T> {
if let [.., last] = self { Some(last) } else { None }
Expand Down

0 comments on commit 9854d30

Please sign in to comment.