diff options
| author | Tyler Mandry <tmandry@gmail.com> | 2019-10-29 12:01:47 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-10-29 12:01:47 -0700 |
| commit | 73dcb969055826c035a572f977e81f8cb52409cf (patch) | |
| tree | 68b19a2be5b007a25f0680c71da53381490b6f99 | |
| parent | 4359666daa6dea916ed1e9700ae8cccaf2f46e2f (diff) | |
| parent | bc98c86a8b966fdd83756309ddb0e5b53dfccf37 (diff) | |
| download | rust-73dcb969055826c035a572f977e81f8cb52409cf.tar.gz rust-73dcb969055826c035a572f977e81f8cb52409cf.zip | |
Rollup merge of #65930 - lzutao:new-feature-gate-c_void, r=dtolnay
doc: use new feature gate for c_void type Closes #63694, closes #55619
| -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", |
