Don't use empty enum for opaque FFI type anymore
Open
- Dominant language
- JavaScript
- Stars
- 2k
- Forks
- 179
- PR merge metrics
- No merged PRs in 30d
Description
We have:
https://github.com/Boscop/web-view/blob/00bbb3adfd152f0509a9e577b78572c0a26f1a0f/webview-sys/lib.rs#L13
Even though the book was recommending to use empty enums for opaque FFI pointer types, it's not recommended anymore because it turned out it's UB:
https://www.reddit.com/r/rust/comments/a3bf2p/patterns_of_refactoring_c_to_rust_the_case_of/eb5xqje/
So it should be
```rust
#[repr(C)] pub struct CWebView { _private: [u8; 0] }
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.