Skip to content

Commit d8383b6

Browse files
nico-abramGankra
authored andcommitted
Clarify that any alignment is valid for ZSTs
1 parent 23c49f1 commit d8383b6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/repr-rust.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ Primitives are usually aligned to their size, although this is
1111
platform-specific behavior. For example, on x86 `u64` and `f64` are often
1212
aligned to 4 bytes (32 bits).
1313

14-
A type's size must always be a multiple of its alignment. This ensures that an
15-
array of that type may always be indexed by offsetting by a multiple of its
16-
size. Note that the size and alignment of a type may not be known
17-
statically in the case of [dynamically sized types][dst].
14+
A type's size must always be a multiple of its alignment (Zero being a valid size
15+
for any alignment). This ensures that an array of that type may always be indexed
16+
by offsetting by a multiple of its size. Note that the size and alignment of a
17+
type may not be known statically in the case of [dynamically sized types][dst].
1818

1919
Rust gives you the following ways to lay out composite data:
2020

0 commit comments

Comments
 (0)