I have an array for which MaybeUninit::array_assume_init() would be a perfect fit:
an input array of
[MaybeUninit<T>; LEN] and from that I need an
[T; LEN] for some const generic
Further constraints of note:
T doesn't necessarily implement the
Clone trait. So aside from it being potentially inefficient, element-wise cloning is not an option.
The issue is that
MaybeUninit::array_assume_init() is still unstable.
I have looked at its source code, and that uses intrinsics, so copying the code, assuming the risk, and calling it a day won't work either.
What can I use as a workaround until it becomes stable?