We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
size_of_val
1 parent 8645296 commit 6a1701eCopy full SHA for 6a1701e
core/src/hash/mod.rs
@@ -834,7 +834,7 @@ mod impls {
834
835
#[inline]
836
fn hash_slice<H: ~const Hasher>(data: &[$ty], state: &mut H) {
837
- let newlen = data.len() * mem::size_of::<$ty>();
+ let newlen = mem::size_of_val(data);
838
let ptr = data.as_ptr() as *const u8;
839
// SAFETY: `ptr` is valid and aligned, as this macro is only used
840
// for numeric primitives which have no padding. The new slice only
0 commit comments