]> git.proxmox.com Git - rustc.git/blobdiff - src/vendor/precomputed-hash/src/lib.rs
New upstream version 1.23.0+dfsg1
[rustc.git] / src / vendor / precomputed-hash / src / lib.rs
index 53df5dbffe2a2138dc0db079aa71bcceb503478f..9cdb45d5b273a41d200f1e9bcc08939c84ce2b43 100644 (file)
@@ -7,3 +7,16 @@ pub trait PrecomputedHash {
     /// Return the precomputed hash for this item.
     fn precomputed_hash(&self) -> u32;
 }
+
+// These are equivalent to the `std::Hash` impls.
+impl<'a, T: PrecomputedHash> PrecomputedHash for &'a T {
+    fn precomputed_hash(&self) -> u32 {
+        (**self).precomputed_hash()
+    }
+}
+
+impl<'a, T: PrecomputedHash> PrecomputedHash for &'a mut T {
+    fn precomputed_hash(&self) -> u32 {
+        (**self).precomputed_hash()
+    }
+}