1
Fork 0

Rollup merge of #112136 - clarfonthey:ffi-c_str, r=cuviper

Add std::ffi::c_str module

ACP: rust-lang/libs-team#134

`std::ffi` docs before change:
![Structs: VaList, VaListImpl, CStr, CString, FromBytesWithNulError, FromVecWithNulError, IntoStringError, NulError, OsStr, OsString](https://github.com/rust-lang/rust/assets/15850505/b2cf3534-30f9-4ef0-a655-bacdc3a19e17)

`std::ffi` docs after change:
![Re-exports: self::c_str::{FromBytesWithNulError, FromBytesUntilNulError, FromVecWithNulError, NulError, IntoStringError} ; Modules: c_str ; Structs: VaList, VaListImpl, CStr, CString, OsStr, OsString](https://github.com/rust-lang/rust/assets/15850505/23aa6964-da7a-4942-bbf7-42bde2146f9e)

(note: I'm omitting the `c_int`, etc. stuff from the screenshots since it's the same in both. this doesn't just delete those types)
This commit is contained in:
Matthias Krüger 2024-03-10 10:58:14 +01:00 committed by GitHub
commit 1b44889ec2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 80 additions and 17 deletions

View file

@ -1,3 +1,5 @@
//! [`CString`] and its related types.
#[cfg(test)]
mod tests;

View file

@ -80,9 +80,13 @@
#![stable(feature = "alloc_ffi", since = "1.64.0")]
#[doc(no_inline)]
#[stable(feature = "alloc_c_string", since = "1.64.0")]
pub use self::c_str::FromVecWithNulError;
#[stable(feature = "alloc_c_string", since = "1.64.0")]
pub use self::c_str::{CString, IntoStringError, NulError};
pub use self::c_str::{FromVecWithNulError, IntoStringError, NulError};
mod c_str;
#[doc(inline)]
#[stable(feature = "alloc_c_string", since = "1.64.0")]
pub use self::c_str::CString;
#[unstable(feature = "c_str_module", issue = "112134")]
pub mod c_str;