forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#130428 - ink-feather-org:stabilize-const-sp…
…lit-at-mut, r=RalfJung Stabilize `const_slice_split_at_mut` and `const_slice_first_last_chunk` Stabilizes rust-lang#101804 and the remainder of rust-lang#111774. FCP proposed in the tracking issue. Requires rust-lang#130403 (or it would need a rustc_allow_const_fn_unstable for it) Stabilized const API: ```rust // slice impl [T] { pub const fn split_at_mut(&mut self, mid: usize) -> (&mut [T], &mut [T]); pub const fn split_at_mut_unchecked(&mut self, mid: usize) -> (&mut [T], &mut [T]); pub const fn split_at_mut_checked(&mut self, mid: usize) -> Option<(&mut [T], &mut [T])>; pub const fn first_chunk_mut<const N: usize>(&mut self) -> Option<&mut [T; N]>; pub const fn last_chunk_mut<const N: usize>(&mut self) -> Option<&mut [T; N]>; pub const fn split_first_chunk_mut<const N: usize>(&mut self) -> Option<(&mut [T; N], &mut [T])>; pub const fn split_last_chunk_mut<const N: usize>(&mut self) -> Option<(&mut [T; N], &mut [T])>; } ``` Closes rust-lang#101804 Closes rust-lang#111774 cc `@RalfJung`
- Loading branch information
Showing
2 changed files
with
14 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters