Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mention "extern types" on the opaque structs section #273

Merged
merged 2 commits into from
Jun 18, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/ffi.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, instead of starting off with talking about something that is unstable and likely something people can't use, what do you think about moving into a side note? That is, take what you have written here, and move it down to the bottom of the page and make it a blockquote.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good! Addressed via 538345a.


[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);
Expand Down