Rollup merge of #128619 - glandium:last_chunk, r=scottmcm

Correct the const stabilization of `<[T]>::last_chunk`

`<[T]>::first_chunk` became const stable in 1.77, but `<[T]>::last_chunk` was left out. This was fixed in 3488679768, which reached stable in 1.80, making `<[T]>::last_chunk` const stable as of that version, but it is documented as being const stable as 1.77. While this is what should have happened, the documentation should reflect what actually did happen.
This commit is contained in:
Matthias Krüger 2024-08-05 08:22:24 +02:00 committed by GitHub
commit 74df517b90
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -522,7 +522,7 @@ pub const fn split_last_chunk_mut<const N: usize>(
/// ``` /// ```
#[inline] #[inline]
#[stable(feature = "slice_first_last_chunk", since = "1.77.0")] #[stable(feature = "slice_first_last_chunk", since = "1.77.0")]
#[rustc_const_stable(feature = "slice_first_last_chunk", since = "1.77.0")] #[rustc_const_stable(feature = "const_slice_last_chunk", since = "1.80.0")]
pub const fn last_chunk<const N: usize>(&self) -> Option<&[T; N]> { pub const fn last_chunk<const N: usize>(&self) -> Option<&[T; N]> {
if self.len() < N { if self.len() < N {
None None