I have an array with [ManuallyDrop<Box<T>>]
which is filled lazily. To realize this, I "initialize" the array with ManuallyDrop::new(mem::uninitialized())
.
Is this well-defined behavior as long as I only call ManuallyDrop::drop()
on initialized elements?
Vec::with_capacity()
,push(mem::uninitialized())
,into_boxed_slice()
– Raeraeannpush(ManuallyDrop::new(mem::uninitialized()))
– Raeraeannunitialized()
for the entire array – NeogothicMaybeUninit
, since I'm on nightly anyway. – Raeraeann