Closed
Description
Feature gate: #![feature(const_cstr_methods)]
This is a tracking issue for CStr
methods as const
functions.
Public API
// core::ffi
impl CStr {
// feature(const_cstr_methods)
pub const fn from_bytes_with_nul(bytes: &[u8]) -> Result<&Self, FromBytesWithNulError>;
pub const fn to_bytes(&self) -> &[u8];
pub const fn to_bytes_with_nul(&self) -> &[u8];
pub const fn to_str(&self) -> Result<&str, str::Utf8Error>;
}
// Note that those methods are stable, they are only unstable as `const` fn
Steps / History
- Implementation: constify some
CStr
methods #100291 - Final comment period (FCP)1
- Stabilization PR Stabilize
const_cstr_methods
#107624
Unresolved Questions
- None yet.