Open
Description
Feature gate: #![feature(const_str_from_utf8)]
This is a tracking issue for str::{from_utf8, from_utf8_mut}
and str::Utf8Error::{valid_up_to, error_len}
as const fn
Public API
// core::str
pub const fn from_utf8_mut(v: &mut [u8]) -> Result<&mut str, Utf8Error>;
impl str {
pub const fn from_utf8_mut(v: &mut [u8]) -> Result<&mut str, Utf8Error>;
}
Public API (stabilized in Rust 1.63)
// core::str
pub const fn from_utf8(v: &[u8]) -> Result<&str, Utf8Error>;
impl Utf8Error {
pub const fn valid_up_to(&self) -> usize;
pub const fn error_len(&self) -> Option<usize>;
}
Steps / History
- Implementation: Make slice->str conversion and related functions
const
#90607 - Final comment period (FCP) (
&
functions) - Stabilization PR (
&
functions) - Final comment period (FCP) (
&mut
function) - Stabilization PR (
&mut
function)
Unresolved Questions
- None yet.