-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
Hello, I think there is a unsoundness problem in the following code.
pub fn to_bytes<T>(t: &T) -> &[u8] {
unsafe {
let len = core::intrinsics::size_of_val(t);
let ptr: *const u8 = core::intrinsics::transmute(t);
core::slice::from_raw_parts(ptr, len)
}
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels