Types without #[repr()] in external functions
Dr-Emann opened this issue · comments
Zachary Dremann commented
Functions take Lang
and Script
which are not annotated with a #[repr()] annotation in whatlang. C-Like Enums without #[repr()] are currently represented by the smallest integer size which can hold all values, but this is not guaranteed.
Serhii Potapov commented
You're right.
I just post it here for myself: https://doc.rust-lang.org/nomicon/other-reprs.html
. Any type you expect to pass through an FFI boundary should have repr(C), as C is the lingua-franca of the programming world.