Skip to content

Commit ef63d06

Browse files
authored
Fix order of operations typo in RFC 2514
It's minor, but also a surprisingly confusing typo if you're new to this feature.
1 parent ff29887 commit ef63d06

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ and while writing to a union field is safe, taking a reference is not.
201201

202202
For this reason, `DerefMut` auto-deref is not applied when working on a union or
203203
its fields. However, note that manually dereferencing is still possible, so
204-
`*(u.f).0 = Vec::new()` is still a way to drop an uninitialized field! But this
204+
`(*u.f).0 = Vec::new()` is still a way to drop an uninitialized field! But this
205205
can never happen when no `*` is involved, and hopefully dereferencing an element
206206
of a union is a clear enough signal that the union better be initialized
207207
properly for this to make sense.

0 commit comments

Comments
 (0)