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.
StableHasherResult
u128
1 parent 60ac9f4 commit 70fa1fbCopy full SHA for 70fa1fb
src/librustc_data_structures/stable_hasher.rs
@@ -78,6 +78,17 @@ impl StableHasherResult for [u8; 20] {
78
}
79
80
81
+impl StableHasherResult for u128 {
82
+ fn finish(mut hasher: StableHasher<Self>) -> Self {
83
+ let hash_bytes: &[u8] = hasher.finalize();
84
+ assert!(hash_bytes.len() >= mem::size_of::<u64>() * 2);
85
+
86
+ unsafe {
87
+ ::std::ptr::read_unaligned(hash_bytes.as_ptr() as *const u128)
88
+ }
89
90
+}
91
92
impl StableHasherResult for u64 {
93
fn finish(mut hasher: StableHasher<Self>) -> Self {
94
hasher.state.finalize();
0 commit comments