diff --git a/src/libcore/ffi.rs b/src/libcore/ffi.rs index 0ea4187ccd482..569c667ac0a54 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 69fcfa8b39ca5..28d9906eb93b5 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",