Skip to content

Commit 094b801

Browse files
committed
Reword
1 parent efec627 commit 094b801

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

reference/src/layout/unions.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ not to change until an RFC ratifies them.
88

99
### Layout of individual union fields
1010

11-
When laying out an `union`, the compiler has to decide how the fields of the
12-
union are arranged. Union fields are laid out by the compiler "on top" of each
13-
other, that is, the bytes of one field might overlap with the bytes of another
14-
field - as opposed to, e.g., `struct`s, where the fields are laid out "next to"
15-
each other, such that the bytes of one field never overlap with the bytes of
16-
another field. This can be visualized as follows:
11+
The main degree of freedom the compiler has when computing the layout of a union
12+
is to determine the offset of the fields. Union fields are laid out by the
13+
compiler "on top" of each other, that is, the bytes of one field might overlap
14+
with the bytes of another field - as opposed to, e.g., `struct`s, where the
15+
fields are laid out "next to" each other, such that the bytes of one field never
16+
overlap with the bytes of another field. This can be visualized as follows:
1717

1818
```rust,ignore
1919
[ P P [field0_ty] P P P P ]

0 commit comments

Comments
 (0)