Tracking Issue for const checked slice to str conversions · Issue #91006 · rust-lang/rust (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

@WaffleLapkin

Description

@WaffleLapkin

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; }

Steps / History

Unresolved Questions