rust/library/core/src/ffi
Guillaume Gomez 7fc3183520
Rollup merge of #100291 - WaffleLapkin:cstr_const_methods, r=oli-obk
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 )
2022-09-12 22:47:14 +02:00
..
c_char.md Temporarily make CStr not a link in the c_char docs 2022-03-01 17:36:40 -08:00
c_double.md Fix naming format of IEEE 754 standard 2022-09-11 04:13:33 +02:00
c_float.md Fix naming format of IEEE 754 standard 2022-09-11 04:13:33 +02:00
c_int.md Provide C FFI types via core::ffi, not just in std 2022-03-01 17:16:05 -08:00
c_long.md Provide C FFI types via core::ffi, not just in std 2022-03-01 17:16:05 -08:00
c_longlong.md Provide C FFI types via core::ffi, not just in std 2022-03-01 17:16:05 -08:00
c_schar.md Provide C FFI types via core::ffi, not just in std 2022-03-01 17:16:05 -08:00
c_short.md Provide C FFI types via core::ffi, not just in std 2022-03-01 17:16:05 -08:00
c_str.rs Rollup merge of #100291 - WaffleLapkin:cstr_const_methods, r=oli-obk 2022-09-12 22:47:14 +02:00
c_uchar.md Provide C FFI types via core::ffi, not just in std 2022-03-01 17:16:05 -08:00
c_uint.md Provide C FFI types via core::ffi, not just in std 2022-03-01 17:16:05 -08:00
c_ulong.md Provide C FFI types via core::ffi, not just in std 2022-03-01 17:16:05 -08:00
c_ulonglong.md Provide C FFI types via core::ffi, not just in std 2022-03-01 17:16:05 -08:00
c_ushort.md Provide C FFI types via core::ffi, not just in std 2022-03-01 17:16:05 -08:00
c_void.md Provide C FFI types via core::ffi, not just in std 2022-03-01 17:16:05 -08:00
mod.rs Stabilize core::ffi::CStr, alloc::ffi::CString, and friends 2022-07-15 03:10:35 -07:00