Tracking Issue for `const_split_off_first_last`
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
Feature gate: #![feature(const_split_off_first_last)]
This is a tracking issue for using <[T]>::split_off_* functions in const. These functions remove either the first or last element from a slice and return a reference or mutable reference to that element.
The original functions were stabilized with the slice_take feature.
slice_take tracking issue: #62280
Public API
impl<T> [T] {
pub const fn split_off_first<'a>(self: &mut &'a Self) -> Option<&'a T>;
pub const fn split_off_first_mut<'a>(self: &mut &'a mut Self) -> Option<&'a mut T>;
pub const fn split_off_last<'a>(self: &mut &'a Self) -> Option<&'a T>;
pub const fn split_off_last_mut<'a>(self: &mut &'a mut Self) -> Option<&'a mut T>;
}
Steps / History
- Implementation: #138540
- Final comment period (FCP)^1
- Stabilization PR
Unresolved Questions
- None yet.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the public API and Steps / History, then inspect implementation PR #138540; no source file or test is named in the issue. The tracking work is complete when the remaining FCP and stabilization steps are resolved and the API is stabilized.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100