Closed
Description
The docs for ptr::drop_in_place
state:
Unaligned values cannot be dropped in place, they must be copied to an aligned location first:
And include an example which uses ptr::copy
to copy the value from an unaligned pointer into an aligned one. However, the docs for ptr::copy
state:
Both
src
anddst
must be properly aligned.
Either the docs for ptr::copy
are wrong, and src
does not need to be aligned, or the example for drop_in_place
invokes UB and should be updated to use read_unaligned