mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-30 06:43:20 +03:00
3a0fa0375d
Most of these problems originate in use of get_unchecked_mut. When calling ptr::copy_nonoverlapping, using get_unchecked_mut for both arguments causes the borrow created to make the second pointer to invalid the first. The pairs of identical MaybeUninit::slice_as_mut_ptr calls similarly invalidate each other. There was also a similar borrow invalidation problem with the use of slice::get_unchecked_mut to derive the pointer for the CopyOnDrop.