File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -41,10 +41,10 @@ Unions have no notion of an "active field". Instead, every union access just
4141interprets the storage at the type of the field used for the access. Reading a
4242union field reads the bits of the union at the field's type. It is the
4343programmer's responsibility to make sure that the data is valid at that
44- type. Failing to do so results in undefined behavior (for example, reading the
45- value ` 3 ` at type ` bool ` is undefined behavior) . Effectively, writing to and
46- then reading from a union is equivalent to a [ ` transmute ` ] from the type used
47- for writing to the type used for reading.
44+ type. Failing to do so results in undefined behavior. For example, reading the
45+ value ` 3 ` at type ` bool ` is undefined behavior. Effectively, writing to and then
46+ reading from a union is equivalent to a [ ` transmute ` ] from the type used for
47+ writing to the type used for reading.
4848
4949Consequently, all reads of union fields have to be placed in ` unsafe ` blocks:
5050
You can’t perform that action at this time.
0 commit comments