Open Nugine opened 3 years ago
Transmuting bytes to an arbitrary type can cause undefined behavior.
The safety requirements:
T
Sized
size_of::<T>()
align_of::<T>()
https://github.com/johalun/sysctl-rs/blob/57c05e11519b26caed6ccc9260a3b84e185f80d1/src/unix/funcs.rs#L367-L369
+1
Transmuting bytes to an arbitrary type can cause undefined behavior.
The safety requirements:
T
must beSized
.size_of::<T>()
.align_of::<T>()
.T
must be valid for any binary representation.https://github.com/johalun/sysctl-rs/blob/57c05e11519b26caed6ccc9260a3b84e185f80d1/src/unix/funcs.rs#L367-L369