Skip to content

Stabilise std::ffi::c_str #137439

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions library/alloc/src/ffi/c_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -821,6 +821,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;

Expand All @@ -833,6 +834,7 @@ impl FromStr for CString {
}
}

#[stable(feature = "c_string_from_str", since = "1.85.0")]
impl TryFrom<CString> for String {
type Error = IntoStringError;

Expand Down
2 changes: 1 addition & 1 deletion library/alloc/src/ffi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
2 changes: 1 addition & 1 deletion library/core/src/ffi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion library/std/src/ffi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down
1 change: 0 additions & 1 deletion library/std/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,6 @@
#![feature(array_chunks)]
#![feature(bstr)]
#![feature(bstr_internals)]
#![feature(c_str_module)]
#![feature(char_internals)]
#![feature(clone_to_uninit)]
#![feature(core_intrinsics)]
Expand Down
Loading