Tracking Issue for const_split_off_first_last · Issue #138539 · rust-lang/rust (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

@okaneco

Description

@okaneco

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] { 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

Unresolved Questions

  1. https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html