mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 08:44:35 +00:00
7fc3183520
constify some `CStr` methods This PR marks the following public APIs as `const`: ```rust impl CStr { // feature(const_cstr_from_bytes) pub const fn from_bytes_until_nul(bytes: &[u8]) -> Result<&CStr, FromBytesUntilNulError>; pub const fn from_bytes_with_nul(bytes: &[u8]) -> Result<&Self, FromBytesWithNulError>; // feature(const_cstr_to_bytes) 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>; } ``` r? ```@oli-obk``` (use of `const_eval_select` :P ) cc ```@mina86``` (you've asked for this <3 ) |
||
---|---|---|
.. | ||
alloc | ||
backtrace@07872f28cd | ||
core | ||
panic_abort | ||
panic_unwind | ||
portable-simd | ||
proc_macro | ||
profiler_builtins | ||
rtstartup | ||
rustc-std-workspace-alloc | ||
rustc-std-workspace-core | ||
rustc-std-workspace-std | ||
std | ||
stdarch@42df7394d3 | ||
test | ||
unwind |