Skip to content

Commit 75eb897

Browse files
authored
Merge pull request #456 from thinety/unit-in-opaque-type
Use `()` instead of `[u8; 0]` in opaque type
2 parents bc22988 + 38f5394 commit 75eb897

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ffi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -891,13 +891,13 @@ To do this in Rust, let’s create our own opaque types:
891891
```rust
892892
#[repr(C)]
893893
pub struct Foo {
894-
_data: [u8; 0],
894+
_data: (),
895895
_marker:
896896
core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
897897
}
898898
#[repr(C)]
899899
pub struct Bar {
900-
_data: [u8; 0],
900+
_data: (),
901901
_marker:
902902
core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
903903
}

0 commit comments

Comments
 (0)