From 9387d3598493f338c0c82f70add6628dc9549680 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Thu, 10 Jun 2021 04:59:39 +0900 Subject: [PATCH] Mention "extern types" on the opaque structs section --- src/ffi.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/ffi.md b/src/ffi.md index a8383d6..387510a 100644 --- a/src/ffi.md +++ b/src/ffi.md @@ -705,8 +705,14 @@ for more information. # Representing opaque structs Sometimes, a C library wants to provide a pointer to something, but not let you -know the internal details of the thing it wants. The simplest way is to use a -`void *` argument: +know the internal details of the thing it wants. The simplest way is to use "extern types". +But it's currently (as of June 2021) unstable and has some unresolved questions, +see the [RFC page][extern-type-rfc] and the [tracking issue][extern-type-issue] for more details. + +[extern-type-issue]: https://github.com/rust-lang/rust/issues/43467 +[extern-type-rfc]: https://rust-lang.github.io/rfcs/1861-extern-types.html + +Alternatively, we can use a `void *` argument: ```c void foo(void *arg);