File tree 1 file changed +6
-6
lines changed
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -8,12 +8,12 @@ not to change until an RFC ratifies them.
8
8
9
9
### Layout of individual union fields
10
10
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:
17
17
18
18
``` rust,ignore
19
19
[ P P [field0_ty] P P P P ]
You can’t perform that action at this time.
0 commit comments