Skip to content

Commit bc8c713

Browse files
committed
Replace c_void with core::ffi::c_void
1 parent 26a52bc commit bc8c713

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed

secp256k1-sys/src/types.rs

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![allow(non_camel_case_types)]
2-
use core::fmt;
32

43
pub type c_int = i32;
54
pub type c_uchar = u8;
@@ -10,23 +9,7 @@ pub type size_t = usize;
109
/// The way we use it makes it fine either way but this type shouldn't be used outside of the library.
1110
pub type c_char = i8;
1211

13-
/// This is an exact copy of <https://doc.rust-lang.org/core/ffi/enum.c_void.html>
14-
/// It should be Equivalent to C's void type when used as a pointer.
15-
///
16-
/// We can replace this with `core::ffi::c_void` once we update the rustc version to >=1.30.0.
17-
#[repr(u8)]
18-
pub enum c_void {
19-
#[doc(hidden)]
20-
__variant1,
21-
#[doc(hidden)]
22-
__variant2,
23-
}
24-
25-
impl fmt::Debug for c_void {
26-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
27-
f.pad("c_void")
28-
}
29-
}
12+
pub use core::ffi::c_void;
3013

3114
/// A type that is as aligned as the biggest alignment for fundamental types in C
3215
/// since C11 that means as aligned as `max_align_t` is.
@@ -46,7 +29,7 @@ impl AlignedType {
4629
}
4730

4831
#[cfg(all(feature = "std", not(rust_secp_no_symbol_renaming)))]
49-
pub(crate) const ALIGN_TO: usize = ::core::mem::align_of::<AlignedType>();
32+
pub(crate) const ALIGN_TO: usize = core::mem::align_of::<AlignedType>();
5033

5134
#[cfg(test)]
5235
mod tests {

0 commit comments

Comments
 (0)