Skip to content

Commit

Permalink
Merge pull request #456 from thinety/unit-in-opaque-type
Browse files Browse the repository at this point in the history
Use `()` instead of `[u8; 0]` in opaque type
  • Loading branch information
JohnTitor authored Feb 2, 2025
2 parents bc22988 + 38f5394 commit 75eb897
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ffi.md
Original file line number Diff line number Diff line change
Expand Up @@ -891,13 +891,13 @@ To do this in Rust, let’s create our own opaque types:
```rust
#[repr(C)]
pub struct Foo {
_data: [u8; 0],
_data: (),
_marker:
core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}
#[repr(C)]
pub struct Bar {
_data: [u8; 0],
_data: (),
_marker:
core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
}
Expand Down

0 comments on commit 75eb897

Please sign in to comment.