diff options
| author | Matthias Krüger <476013+matthiaskrgr@users.noreply.github.com> | 2025-04-27 11:54:56 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-27 11:54:56 +0200 |
| commit | 9630242e5ee6b0c7eaaee7b9d9a1a5b567b66761 (patch) | |
| tree | fc3bf18a623e274a2527463f02c2c79f4db30051 | |
| parent | 496145b9cc023aef4bb1f16c0964a53d0da36c88 (diff) | |
| parent | 6be84b1f3863c93f87946a1efd86120966d703dc (diff) | |
| download | rust-9630242e5ee6b0c7eaaee7b9d9a1a5b567b66761.tar.gz rust-9630242e5ee6b0c7eaaee7b9d9a1a5b567b66761.zip | |
Rollup merge of #137439 - clarfonthey:c-str-module, r=tgross35
Stabilise `std::ffi::c_str` This finished FCP in #112134 but never actually got a stabilisation PR. Since the FCP in #120048 recently passed to add the `os_str` module, it would be nice to also merge this too, to ensure that both get added in the next version. Note: The added stability attributes which *somehow* were able to be omitted before (rustc bug?) were added based on the fact that they were added in 302551388b1942bb4216bb5a15d9d55cee3643a8, which ended up in 1.85.0. Closes: https://github.com/rust-lang/rust/issues/112134 r? libs-api
| -rw-r--r-- | library/alloc/src/ffi/c_str.rs | 2 | ||||
| -rw-r--r-- | library/alloc/src/ffi/mod.rs | 2 | ||||
| -rw-r--r-- | library/core/src/ffi/mod.rs | 2 | ||||
| -rw-r--r-- | library/std/src/ffi/mod.rs | 2 | ||||
| -rw-r--r-- | library/std/src/lib.rs | 1 |
5 files changed, 5 insertions, 4 deletions
diff --git a/library/alloc/src/ffi/c_str.rs b/library/alloc/src/ffi/c_str.rs index d5b19470e31..2d05be51811 100644 --- a/library/alloc/src/ffi/c_str.rs +++ b/library/alloc/src/ffi/c_str.rs @@ -818,6 +818,7 @@ impl From<Vec<NonZero<u8>>> for CString { } } +#[stable(feature = "c_string_from_str", since = "1.85.0")] impl FromStr for CString { type Err = NulError; @@ -830,6 +831,7 @@ impl FromStr for CString { } } +#[stable(feature = "c_string_from_str", since = "1.85.0")] impl TryFrom<CString> for String { type Error = IntoStringError; diff --git a/library/alloc/src/ffi/mod.rs b/library/alloc/src/ffi/mod.rs index 695d7ad07cf..05a2763a225 100644 --- a/library/alloc/src/ffi/mod.rs +++ b/library/alloc/src/ffi/mod.rs @@ -87,5 +87,5 @@ pub use self::c_str::CString; #[stable(feature = "alloc_c_string", since = "1.64.0")] pub use self::c_str::{FromVecWithNulError, IntoStringError, NulError}; -#[unstable(feature = "c_str_module", issue = "112134")] +#[stable(feature = "c_str_module", since = "CURRENT_RUSTC_VERSION")] pub mod c_str; diff --git a/library/core/src/ffi/mod.rs b/library/core/src/ffi/mod.rs index 9bae5fd466a..c9c73a25d89 100644 --- a/library/core/src/ffi/mod.rs +++ b/library/core/src/ffi/mod.rs @@ -20,7 +20,7 @@ pub use self::c_str::FromBytesUntilNulError; pub use self::c_str::FromBytesWithNulError; use crate::fmt; -#[unstable(feature = "c_str_module", issue = "112134")] +#[stable(feature = "c_str_module", since = "CURRENT_RUSTC_VERSION")] pub mod c_str; #[unstable( diff --git a/library/std/src/ffi/mod.rs b/library/std/src/ffi/mod.rs index d34e3ca00b9..bd9446f5aba 100644 --- a/library/std/src/ffi/mod.rs +++ b/library/std/src/ffi/mod.rs @@ -161,7 +161,7 @@ #![stable(feature = "rust1", since = "1.0.0")] -#[unstable(feature = "c_str_module", issue = "112134")] +#[stable(feature = "c_str_module", since = "CURRENT_RUSTC_VERSION")] pub mod c_str; #[stable(feature = "core_c_void", since = "1.30.0")] diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs index f77bf92a806..3c22b8a5589 100644 --- a/library/std/src/lib.rs +++ b/library/std/src/lib.rs @@ -329,7 +329,6 @@ #![feature(array_chunks)] #![feature(bstr)] #![feature(bstr_internals)] -#![feature(c_str_module)] #![feature(char_internals)] #![feature(clone_to_uninit)] #![feature(core_intrinsics)] |
