transmute_mut! documents the requirements that:
T: Sized + IntoBytes
U: Sized + FromBytes
align_of::<T>() >= align_of::<U>()
However, this is less strict that what is actually required:
T: FromBytes + IntoBytes + NoCell
U: FromBytes + IntoBytes + NoCell
size_of::<T>() == size_of::<U>()
align_of::<T>() >= align_of::<U>()
The size and NoCell requirements are also similarly missing from transmute_ref!.
transmute_mut!documents the requirements that:T: Sized + IntoBytesU: Sized + FromBytesalign_of::<T>() >= align_of::<U>()However, this is less strict that what is actually required:
T: FromBytes + IntoBytes + NoCellU: FromBytes + IntoBytes + NoCellsize_of::<T>() == size_of::<U>()align_of::<T>() >= align_of::<U>()The size and
NoCellrequirements are also similarly missing fromtransmute_ref!.