Skip to content

Commit

Permalink
Auto merge of rust-lang#124836 - tgross35:const-slice-last-chunk, r=B…
Browse files Browse the repository at this point in the history
…urntSushi

Correct the const stabilization of `last_chunk` for slices

`<[T]>::last_chunk` should have become const stable as part of <rust-lang#117561>. Update the const stability gate to reflect this.
  • Loading branch information
bors committed May 7, 2024
2 parents 14081a2 + 3488679 commit cc8d9b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/core/src/slice/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ impl<T> [T] {
/// ```
#[inline]
#[stable(feature = "slice_first_last_chunk", since = "1.77.0")]
#[rustc_const_unstable(feature = "const_slice_first_last_chunk", issue = "111774")]
#[rustc_const_stable(feature = "slice_first_last_chunk", since = "1.77.0")]
pub const fn last_chunk<const N: usize>(&self) -> Option<&[T; N]> {
if self.len() < N {
None
Expand Down

0 comments on commit cc8d9b6

Please sign in to comment.