Skip to content

Commit 5b45a89

Browse files
authored
Prefix private fields with _
1 parent 36a7633 commit 5b45a89

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
@@ -740,8 +740,8 @@ void bar(struct Bar *arg);
740740
To do this in Rust, let’s create our own opaque types:
741741
742742
```rust
743-
#[repr(C)] pub struct Foo { private: [u8; 0] }
744-
#[repr(C)] pub struct Bar { private: [u8; 0] }
743+
#[repr(C)] pub struct Foo { _private: [u8; 0] }
744+
#[repr(C)] pub struct Bar { _private: [u8; 0] }
745745
746746
extern "C" {
747747
pub fn foo(arg: *mut Foo);

0 commit comments

Comments
 (0)