Skip to content

Tracking Issue for const checked slice to str conversions #91006

Open
@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<usize>;
}

Steps / History

Unresolved Questions

  • None yet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions