Does the compiler behave differently with MaybeUninit
or with a union with the same structure? If yes, what additional things does it do with MaybeUninit
?
Specifically, is it the same (except for the different methods) to use original MaybeUninit
:
#[repr(transparent)]
pub union MaybeUninit<T> {
uninit: (),
value: ManuallyDrop<T>,
}
or to use:
#[repr(transparent)]
pub union AnotherUninit<T> {
uninit: (),
value: ManuallyDrop<T>,
}