File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -20,8 +20,10 @@ The alignment of a value can be checked with the [`align_of_val`] function.
20
20
21
21
The * size* of a value is the offset in bytes between successive elements in an
22
22
array with that item type including alignment padding. The size of a value is
23
- always a multiple of its alignment. The size of a value can be checked with the
24
- [ ` size_of_val ` ] function.
23
+ always a multiple of its alignment. Note that some types are zero-sized; 0 is
24
+ considered a multiple of any alignment (for example, on some platforms, the type
25
+ ` [u16; 0] ` has size 0 and alignment 2). The size of a value can be checked with
26
+ the [ ` size_of_val ` ] function.
25
27
26
28
Types where all values have the same size and alignment, and both are known at
27
29
compile time, implement the [ ` Sized ` ] trait and can be checked with the
You can’t perform that action at this time.
0 commit comments