Skip to content

Commit d3a66eb

Browse files
authored
Update boolean.md
1 parent bbc8063 commit d3a66eb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/types/boolean.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,12 @@ boolean type for its operands, they evaluate using the rules of [boolean logic].
9292
* `a < b` is the same as `!(a >= b)`
9393
* `a <= b` is the same as `a == b | a < b`
9494

95+
## Bit validity
96+
97+
The single byte of a `bool` is guaranteed to be initialized (in other words,
98+
`transmute::<bool, u8>(...)` is always sound -- but since some bit patterns
99+
are invalid `bool`s, the inverse is not always sound).
100+
95101
[boolean logic]: https://en.wikipedia.org/wiki/Boolean_algebra
96102
[enumerated type]: enum.md
97103
[expressions]: ../expressions.md

0 commit comments

Comments
 (0)