Open clarfonthey opened 1 year ago
@rust-lang/libs-api: @rfcbot fcp merge
This module has been available since 1.78-nightly, and is valuable in tidying all those types you will never need to name out of std::ffi's "Structs" section.
Without modules, are you able to guess whether std::ffi::IntoStringError
refers to the error type returned by std::ffi::CString::into_string
or by std::ffi::OsString::into_string
?
Before:
After:
Team member @dtolnay has proposed to merge this. The next step is review by the rest of the tagged team members:
No concerns currently listed.
Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!
See this document for info about what commands tagged team members can give me.
Note that the os_str
module, while part of the initial ACP, was rejected, and isn't part of this tracking issue. If you'd like to include it as part of the FCP, I would not oppose, but that should be stated explicitly instead of being roped in implicitly. Just don't want to avoid a headache when it comes to stabilisation.
For people wanting to follow std::ffi::os_str
, it's https://github.com/rust-lang/rust/issues/120048 .
:bell: This is now entering its final comment period, as per the review above. :bell:
The final comment period, with a disposition to merge, as per the review above, is now complete.
As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.
This will be merged soon.
Feature gate:
#![feature(c_str_module)]
This is a tracking issue for the
std::ffi::c_str
module.Public API
This adds
{core, alloc, std}::ffi::c_str
modules and migrates some existing types into them. Types will still be re-exported in their current places to ensure compatibility.The following migrations are made:
core::ffi::CStr
=>core::ffi::c_str::CStr
core::ffi::FromBytesUntilNulError
=>core::ffi::c_str::FromBytesUntilNulError
core::ffi::FromBytesWithNulError
=>core::ffi::c_str::FromBytesWithNulError
alloc::ffi::CString
=>alloc::ffi::c_str::CString
alloc::ffi::FromVecWIthNulError
=>alloc::ffi::c_str::FromVecWIthNulError
alloc::ffi::IntoStringError
=>alloc::ffi::c_str::IntoStringError
alloc::ffi::NulError
=>alloc::ffi::c_str::NulError
And these types are also migrated on the
std
crate as well.Steps / History
Unresolved Questions
c_str
andc_string
be separated? This was not discussed in the original ACP.