-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #147 from gnzlbg/val_union
Validity of unions with a zero-sized field
- Loading branch information
Showing
2 changed files
with
15 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Validity of unions | ||
|
||
**Disclaimer**: This chapter is a work-in-progress. What's contained here | ||
represents the consensus from issue [#73]. The statements in here are not (yet) | ||
"guaranteed" not to change until an RFC ratifies them. | ||
|
||
## Validity of unions with zero-sized fields | ||
|
||
A union containing a zero-sized field can contain any bit pattern. An example of such | ||
an union is [`MaybeUninit`]. | ||
|
||
[#73]: https://github.com/rust-lang/unsafe-code-guidelines/issues/73 | ||
[`MaybeUninit`]: https://doc.rust-lang.org/std/mem/union.MaybeUninit.html |