about summary refs log tree commit diff
path: root/library/alloc
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-03-10 10:58:14 +0100
committerGitHub <noreply@github.com>2024-03-10 10:58:14 +0100
commit1b44889ec2d983d7b7fa7566d4048a57b2f7a1c9 (patch)
treebf8ba764da822419d594e00b1c442449e360108f /library/alloc
parent094a6204f590e6b4770b5f26359dd17a07897adf (diff)
parent1ea6cd715e01f14395ee3f7d944ecc68adf0dde4 (diff)
downloadrust-1b44889ec2d983d7b7fa7566d4048a57b2f7a1c9.tar.gz
rust-1b44889ec2d983d7b7fa7566d4048a57b2f7a1c9.zip
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)
Diffstat (limited to 'library/alloc')
-rw-r--r--library/alloc/src/ffi/c_str.rs2
-rw-r--r--library/alloc/src/ffi/mod.rs10
2 files changed, 9 insertions, 3 deletions
diff --git a/library/alloc/src/ffi/c_str.rs b/library/alloc/src/ffi/c_str.rs
index 61ec04a4849..0c7f94ccceb 100644
--- a/library/alloc/src/ffi/c_str.rs
+++ b/library/alloc/src/ffi/c_str.rs
@@ -1,3 +1,5 @@
+//! [`CString`] and its related types.
+
 #[cfg(test)]
 mod tests;
 
diff --git a/library/alloc/src/ffi/mod.rs b/library/alloc/src/ffi/mod.rs
index e8530fbc1f0..9fc1acc231b 100644
--- a/library/alloc/src/ffi/mod.rs
+++ b/library/alloc/src/ffi/mod.rs
@@ -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;
+pub use self::c_str::{FromVecWithNulError, IntoStringError, NulError};
+
+#[doc(inline)]
 #[stable(feature = "alloc_c_string", since = "1.64.0")]
-pub use self::c_str::{CString, IntoStringError, NulError};
+pub use self::c_str::CString;
 
-mod c_str;
+#[unstable(feature = "c_str_module", issue = "112134")]
+pub mod c_str;