Y
Hacker News
new
|
ask
|
show
|
jobs
by
ChrisSD
2540 days ago
According to the nomicon[0], using a zero sized array in a repr(C) struct is the best practice for type safety. I also seem to remember someone saying the zero sized array is analogous to how LLVM bitcode represents void* in C.
[0]
https://doc.rust-lang.org/nomicon/ffi.html#representing-opaq...