Skip to content

Commit

Permalink
Rollup merge of #65930 - lzutao:new-feature-gate-c_void, r=dtolnay
Browse files Browse the repository at this point in the history
doc: use new feature gate for c_void type

Closes #63694, closes #55619
  • Loading branch information
tmandry authored Oct 29, 2019
2 parents 4359666 + bc98c86 commit 73dcb96
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/libcore/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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")]
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/ffi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 73dcb96

Please sign in to comment.