Closed
Description
Feature gate: #![feature(const_str_split_at)]
This is a tracking issue for using str::split_at
, str::split_at_mut
, str::split_at_checked
, str::split_at_mut_checked
in const
, which allows dividing one (mutable) string slice into two (fallibly) at an index during const-eval.
Public API
// core::str
impl str {
pub const fn split_at(&self, mid: usize) -> (&str, &str);
pub const fn split_at_mut(&mut self, mid: usize) -> (&mut str, &mut str);
pub const fn split_at_checked(&self, mid: usize) -> Option<(&str, &str)>;
pub const fn split_at_mut_checked(&mut self, mid: usize) -> Option<(&mut str, &mut str)>;
}
Steps / History
- Implementation: Mark
str::is_char_boundary
andstr::split_at*
unstablyconst
. #131520 - Blocked on Tracking Issue for
const_is_char_boundary
#131516 - Final comment period (FCP)1
- Stabilization PR
Unresolved Questions
- None yet.