diff options
| author | Lzu Tao <taolzu@gmail.com> | 2019-10-29 13:01:54 +0000 |
|---|---|---|
| committer | Lzu Tao <taolzu@gmail.com> | 2019-10-29 13:01:54 +0000 |
| commit | bc98c86a8b966fdd83756309ddb0e5b53dfccf37 (patch) | |
| tree | 58750f31edecb8ba4dd7f19b8b3b73f2ef2409e9 | |
| parent | eb5ef813f0d6e3fe8edd3abb046a18f5b1a8cc48 (diff) | |
| download | rust-bc98c86a8b966fdd83756309ddb0e5b53dfccf37.tar.gz rust-bc98c86a8b966fdd83756309ddb0e5b53dfccf37.zip | |
doc: use new feature gate for c_void type
| -rw-r--r-- | src/libcore/ffi.rs | 7 | ||||
| -rw-r--r-- | src/libstd/ffi/mod.rs | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/libcore/ffi.rs b/src/libcore/ffi.rs index 0ea4187ccd4..569c667ac0a 100644 --- a/src/libcore/ffi.rs +++ b/src/libcore/ffi.rs @@ -18,8 +18,13 @@ use crate::ops::{Deref, DerefMut}; /// stabilized, it is recommended to use a newtype wrapper around an empty /// byte array. See the [Nomicon] for details. /// +/// One could use `std::os::raw::c_void` if they want to support old Rust +/// compiler down to 1.1.0. After Rust 1.30.0, it was re-exported by +/// this definition. For more information, please read [RFC 2521]. +/// /// [pointer]: ../../std/primitive.pointer.html /// [Nomicon]: https://doc.rust-lang.org/nomicon/ffi.html#representing-opaque-structs +/// [RFC 2521]: https://github.com/rust-lang/rfcs/blob/master/text/2521-c_void-reunification.md // N.B., for LLVM to recognize the void pointer type and by extension // functions like malloc(), we need to have it represented as i8* in // LLVM bitcode. The enum used here ensures this and prevents misuse @@ -29,7 +34,7 @@ use crate::ops::{Deref, DerefMut}; // would be uninhabited and at least dereferencing such pointers would // be UB. #[repr(u8)] -#[stable(feature = "raw_os", since = "1.1.0")] +#[stable(feature = "core_c_void", since = "1.30.0")] pub enum c_void { #[unstable(feature = "c_void_variant", reason = "temporary implementation detail", issue = "0")] diff --git a/src/libstd/ffi/mod.rs b/src/libstd/ffi/mod.rs index 69fcfa8b39c..28d9906eb93 100644 --- a/src/libstd/ffi/mod.rs +++ b/src/libstd/ffi/mod.rs @@ -163,7 +163,7 @@ pub use self::c_str::{FromBytesWithNulError}; #[stable(feature = "rust1", since = "1.0.0")] pub use self::os_str::{OsString, OsStr}; -#[stable(feature = "raw_os", since = "1.1.0")] +#[stable(feature = "core_c_void", since = "1.30.0")] pub use core::ffi::c_void; #[unstable(feature = "c_variadic", |
