Skip to content

Commit 06ba02c

Browse files
committed
Union current state. III. Discussion record.
1 parent 36661ec commit 06ba02c

File tree

2 files changed

+28
-3
lines changed

2 files changed

+28
-3
lines changed

active_discussion/unions.md

+27-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
11
# Unions
22

3-
TBD
3+
## Outstanding questions
4+
5+
* Is `#[repr(Rust)]` the bag-o-bytes union repr, or do we want to propose a new repr?
6+
* *Discussion:* [#73: Validity of unions][#73]
7+
* The following questions are all implicitly answered if `#[repr(Rust)]` is the bag-o-bytes repr, but remain open if not:
8+
* Do `#[repr(Rust)]` unions guarantee all fields at offset 0?
9+
* *Discussion*: [#353: Offsets of union fields][#353]
10+
* Do `#[repr(Rust)]` unions have internal padding?
11+
* *Discussion*: [#354: Do #[repr(Rust)] unions have internal padding?][#354]
12+
* Do `#[repr(transparent)]` unions ever have niches?
13+
* *Discussion*: [#364: What is the value model/validity invariant for transparent unions?][#364]
14+
15+
## Closed discussion issues:
16+
17+
* [#13: Representation of unions][#13]
18+
* [#156: Layout of repr(C) unions has padding][#156]
19+
* [#298: Is `repr(transparent)` completely transparent within `repr(Rust)` types?][#298]
20+
* [#352: What is the safety invariant, if any, for unions?][#352]
21+
22+
[#13]: https://github.com/rust-lang/unsafe-code-guidelines/issues/13
23+
[#156]: https://github.com/rust-lang/unsafe-code-guidelines/issues/156
24+
[#298]: https://github.com/rust-lang/unsafe-code-guidelines/issues/298
25+
[#352]: https://github.com/rust-lang/unsafe-code-guidelines/issues/352
26+
[#353]: https://github.com/rust-lang/unsafe-code-guidelines/issues/353
27+
[#354]: https://github.com/rust-lang/unsafe-code-guidelines/issues/354
28+
[#364]: https://github.com/rust-lang/unsafe-code-guidelines/issues/364
29+
[#73]: https://github.com/rust-lang/unsafe-code-guidelines/issues/73

active_discussion/validity.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,7 @@ To start, we will create threads for each major category of types.
140140
allow the remaining bits to be uninitialized?
141141

142142
* Unions
143-
* Do we make any restrictions here, or are unions just "bags of bits" that may
144-
contain anything? That would mean we can do no layout optimizations.
143+
* See [this page](unions.md).
145144

146145
* Enums
147146
* Is there anything to say besides: The discriminant must be valid, and all

0 commit comments

Comments
 (0)