Skip to content

Commit 9fc6737

Browse files
committed
FIX: Use repr(C) MaybeUninitCopy after discussion with RalfJung
We have a recommendation from the unsafe-wg (no rule yet), that repr(C) for unions should work this way, so that we can cast from the union type to one of its fields.
1 parent 345d420 commit 9fc6737

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/maybe_uninit_copy.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
use array::Array;
33

44
#[derive(Copy, Clone)]
5+
#[repr(C)] // for cast from self ptr to value
56
pub union MaybeUninitCopy<T>
67
where T: Copy
78
{

0 commit comments

Comments
 (0)