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.
1 parent b84f981 commit 3029e9eCopy full SHA for 3029e9e
src/libcore/hash/mod.rs
@@ -570,8 +570,9 @@ mod impls {
570
fn hash_slice<H: Hasher>(data: &[$ty], state: &mut H) {
571
let newlen = data.len() * mem::size_of::<$ty>();
572
let ptr = data.as_ptr() as *const u8;
573
- // SAFETY: `ptr` is valid and aligned, the new slice only spans
574
- // across `data` and is never mutated, and its total size is the
+ // SAFETY: `ptr` is valid and aligned, as this macro is only used
+ // for numeric primitives which have no padding. The new slice only
575
+ // spans across `data` and is never mutated, and its total size is the
576
// same as the original `data` so it can't be over `isize::MAX`.
577
state.write(unsafe { slice::from_raw_parts(ptr, newlen) })
578
}
0 commit comments