4 ms·
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
by ChrisSD 7y 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-opaque-structs https://doc.rust-lang.org/nomicon/ffi.html#representing-opaq...