From 5b45a89c37fe9f6650afa5162e15baf831e25c04 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Thu, 23 Nov 2017 14:20:45 +0100 Subject: [PATCH] Prefix private fields with _ --- src/ffi.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ffi.md b/src/ffi.md index 8c2ed29..a558b92 100644 --- a/src/ffi.md +++ b/src/ffi.md @@ -740,8 +740,8 @@ void bar(struct Bar *arg); To do this in Rust, let’s create our own opaque types: ```rust -#[repr(C)] pub struct Foo { private: [u8; 0] } -#[repr(C)] pub struct Bar { private: [u8; 0] } +#[repr(C)] pub struct Foo { _private: [u8; 0] } +#[repr(C)] pub struct Bar { _private: [u8; 0] } extern "C" { pub fn foo(arg: *mut Foo);