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.
This commit is contained in:
bluss
2018-12-22 14:25:16 +01:00
parent 345d420b65
commit 9fc6737e1b
+1
View File
@@ -2,6 +2,7 @@
use array::Array;
#[derive(Copy, Clone)]
#[repr(C)] // for cast from self ptr to value
pub union MaybeUninitCopy<T>
where T: Copy
{