Function transmute_copy
unsafe const fn transmute_copy<Src, Dst>(src: &Src) -> Dst
Interprets src as having type &Dst, and then reads src without moving
the contained value.
This function will unsafely assume the pointer src is valid for [size_of::<Dst>][size_of]
bytes by transmuting &Src to &Dst and then reading the &Dst (except that this is done
in a way that is correct even when &Dst has stricter alignment requirements than &Src).
It will also unsafely create a copy of the contained value instead of moving out of src.
It is not a compile-time error if Src and Dst have different sizes, but it
is highly encouraged to only invoke this function where Src and Dst have the
same size. This function triggers undefined behavior if Dst is larger than
Src.
Examples
use mem;
let foo_array = ;
unsafe
// The contents of 'foo_array' should not have changed
assert_eq!;