Skip to content

Commit 3582e38

Browse files
committed
emphasize that the isize values matter
1 parent 5bc2515 commit 3582e38

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/type-layout.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,7 @@ or to all be representable by the `unsigned int` type.
350350
Nevertheless, the type of the discriminant is `isize`.
351351
The size and alignment of the enum then match that of a C enum with the same
352352
discriminant values (and without a fixed underlying type).
353+
Crucially, the equivalent C type is determined based on the discriminant values *after* they have been cast to `isize`.
353354

354355
> [!NOTE]
355356
> The enum representation in C is implementation defined, so this is really a "best guess". In particular, this may be incorrect when the C code of interest is compiled with certain flags.

0 commit comments

Comments
 (0)