Skip to content

Commit 3724c1f

Browse files
committed
unions and ABI and repr(C)
1 parent 68d1729 commit 3724c1f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

reference/src/representation/unions.md

+4
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,7 @@ a field type to obtain a pointer to any field, and vice versa.
3434
to keep the option of using non-zero offsets open for the future; whether this
3535
is useful depends on what exactly the compiler-assumed invariants about union
3636
contents are.
37+
38+
Even if the offsets happen to be all 0, there might still be differences in the
39+
function call ABI. If you need to pass unions by-value across an FFI boundary,
40+
you have to use `#[repr(C)]`.

0 commit comments

Comments
 (0)