An integer (i*/u*), floating point value (f*), or raw pointer must be initialized, i.e., must not be obtained from uninitialized memory.
What if we implement a user-defined memcpy? The preliminary thought is to use * const u8 to point to every byte and read them to copy every byte to another space. However, what if reading padding bytes? Which is considered uninitialized memory. Does it mean we cannot correctly implement our memcpy in Rust?
What's the difference when using *const MaybeUninit<u8> instead of *const u8? When we want to read u8(namely, bytes), we still need to call assume_init to read that byte, which still requires the byte to be initialized.
You can move or copy a value of type MaybeUninit<u8>without assuming it is initialized. Therefore, you can move or copy a value of another type by pretending it is a [MaybeUninit<u8>] (or MaybeUninit<[u8]>, but if you’re trying to implement memcpy then that doesn’t help).
Do you mean we can assume every byte is of type MaybeUninit<u8>, and we read MaybeUninit<u8> by * const MaybeUninit<u8> and write MaybeUninit<u8> to another space?