Y
Hacker News
new
|
ask
|
show
|
jobs
by
vardump
2490 days ago
> For example, the Rust compiler can and does reorder fields in structs to improve packing.
Yikes! That can be disabled, right?
2 comments
dthul
2490 days ago
Yeah, if you need "C" style struct representation (which guarantees order), you can enable that on a per-struct basis.
link
roca
2490 days ago
Use #[repr(C)] to force C-compatible layout.
link