Skip to content

Commit 33a353f

Browse files
committed
Reword the section on union assignments
1 parent 54bf91e commit 33a353f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

posts/2021-02-11-Rust-1.50.0.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ fn main() {
5454

5555
### Safe assignments to `ManuallyDrop<T>` union fields
5656

57-
Rust 1.49 made it possible to add `ManuallyDrop<T>` fields to a `union`
58-
as part of allowing `Drop` for unions at all; however, unions don't know
59-
which variant is valid (they don't drop any old value on assignment), so
60-
safe Rust has limited this to `Copy` types only, which never `Drop`. Of
61-
course, that's also true of `ManuallyDrop`, so now Rust 1.50 allows safe
62-
assignments to these fields as well.
57+
Rust 1.49 made it possible to add `ManuallyDrop<T>` fields to a `union` as part
58+
of allowing `Drop` for unions at all. However, unions don't drop old values
59+
when a field is assigned, since they don't know which variant was formerly
60+
valid, so safe Rust has limited this to `Copy` types only, which never `Drop`.
61+
Of course, `ManuallyDrop<T>` also doesn't need to `Drop`, so now Rust 1.50
62+
allows safe assignments to these fields as well.
6363

6464
### A niche for `File` on Unix platforms
6565

0 commit comments

Comments
 (0)