Is it legal to copy uninitialized memory using
ptr::copy_nonoverlapping? The use case here is for hashbrown's
Clone implementation, where (for
Copy types) we copy the entire bucket array, some of which may be empty (and therefore uninitialized).
Yes, the memory is just still uninitialized at the destination as well.
@Amanieu also see https://github.com/rust-lang/rust/pull/67827. there was an attempt to put this into the docs but it died off.