Open
Description
Transmuting bytes to an arbitrary type can cause undefined behavior.
The safety requirements:
T
must beSized
.- The length of bytes must be equal to
size_of::<T>()
. - The alignment of bytes must be equal to
align_of::<T>()
. T
must be valid for any binary representation.
Lines 367 to 369 in 57c05e1
Metadata
Metadata
Assignees
Labels
No labels