Merge pull request #456 from thinety/unit-in-opaque-type

Use `()` instead of `[u8; 0]` in opaque type
pull/318/merge
Yuki Okushi 3 weeks ago committed by GitHub
commit 75eb897f1b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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