-
Notifications
You must be signed in to change notification settings - Fork 13.3k
std: Stabilize the ffi
module
#22975
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,24 +10,27 @@ | |
|
||
//! Utilities related to FFI bindings. | ||
|
||
#![unstable(feature = "std_misc", | ||
reason = "module just underwent fairly large reorganization and the dust \ | ||
still needs to settle")] | ||
#![stable(feature = "rust1", since = "1.0.0")] | ||
|
||
pub use self::c_str::{CString, CStr, NulError, IntoBytes}; | ||
#[stable(feature = "rust1", since = "1.0.0")] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Stable reexport? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While not currently recognized by the compiler I've found it useful to see reexports tagged with stability attributes for rustdoc when it doesn't inline documentation and perhaps just helpful when reading code. It doesn't currently serve any semantic purpose though. |
||
pub use self::c_str::{CString, CStr}; | ||
pub use self::c_str::{NulError, IntoBytes}; | ||
#[allow(deprecated)] | ||
pub use self::c_str::c_str_to_bytes; | ||
#[allow(deprecated)] | ||
pub use self::c_str::c_str_to_bytes_with_nul; | ||
|
||
#[stable(feature = "rust1", since = "1.0.0")] | ||
pub use self::os_str::OsString; | ||
#[stable(feature = "rust1", since = "1.0.0")] | ||
pub use self::os_str::OsStr; | ||
|
||
mod c_str; | ||
mod os_str; | ||
|
||
// FIXME (#21670): these should be defined in the os_str module | ||
/// Freely convertible to an `&OsStr` slice. | ||
#[unstable(feature = "std_misc")] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why unstable? Just anticipating generic conversion traits? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah I'm hoping that |
||
pub trait AsOsStr { | ||
/// Convert to an `&OsStr` slice. | ||
fn as_os_str(&self) -> &OsStr; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're moving away from public tuple structs in
std
; this should probably be a normal struct with accessors.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops nevermind.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I always forget that, unlike enum variants, the pub doesn't automatically extend to tuple components...)