Use `()` instead of `[u8; 0]` in opaque type

pull/456/head
Thiago Trannin 4 months ago
parent 0ebdacadbd
commit 3401e89fbd

@ -891,13 +891,13 @@ To do this in Rust, lets create our own opaque types:
```rust ```rust
#[repr(C)] #[repr(C)]
pub struct Foo { pub struct Foo {
_data: [u8; 0], _data: (),
_marker: _marker:
core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
} }
#[repr(C)] #[repr(C)]
pub struct Bar { pub struct Bar {
_data: [u8; 0], _data: (),
_marker: _marker:
core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
} }

Loading…
Cancel
Save