From d415f1c31b83a48b44d88f18629a79c2a42fcf32 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Fri, 16 Dec 2022 11:10:31 -0500 Subject: [PATCH] Add an important assert --- utils/src/memory.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/utils/src/memory.rs b/utils/src/memory.rs index e0b80325a..d6cf37513 100644 --- a/utils/src/memory.rs +++ b/utils/src/memory.rs @@ -71,5 +71,6 @@ pub fn as_byte_array(o: &T) -> &[u8; S] { #[inline(always)] pub fn to_byte_array(o: T) -> [u8; S] { assert_eq!(S, size_of::()); + assert!(!std::mem::needs_drop::()); unsafe { *(&o as *const T).cast() } }