Skip to content

Commit 290ceaa

Browse files
committed
explain drop glue, briefly
1 parent 134ca0b commit 290ceaa

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

text/0000-union-initialization-and-drop.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@
66
# Summary
77
[summary]: #summary
88

9-
Unions do not allow fields of types that require drop glue, but they may still
10-
`impl Drop` themselves. We specify when one may move out of a union field and
11-
when the union's `drop` is called. To avoid undesired implicit calls of drop,
12-
we also restrict the use of `DerefMut` when unions are involved.
9+
Unions do not allow fields of types that require drop glue (the code that is
10+
automatically run when a variables goes out of scope: recursively dropping the
11+
variable and all its fields), but they may still `impl Drop` themselves. We
12+
specify when one may move out of a union field and when the union's `drop` is
13+
called. To avoid undesired implicit calls of drop, we also restrict the use of
14+
`DerefMut` when unions are involved.
1315

1416
# Motivation
1517
[motivation]: #motivation

0 commit comments

Comments
 (0)