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
41
41
interprets the storage at the type of the field used for the access. Reading a
42
42
union field reads the bits of the union at the field's type. It is the
43
43
programmer'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.
48
48
49
49
Consequently, all reads of union fields have to be placed in ` unsafe ` blocks:
50
50
You can’t perform that action at this time.
0 commit comments