about summary refs log tree commit diff
path: root/src/liballoc/boxed.rs
diff options
context:
space:
mode:
authorSteven Fackler <sfackler@gmail.com>2014-12-12 18:43:07 -0800
committerSteven Fackler <sfackler@gmail.com>2014-12-15 22:48:54 -0800
commit24a8ef63ff786dd702d428f73fd64aac2a828f19 (patch)
tree6f47ec4857a28ae6b8f01e20742d089edf2dcd1a /src/liballoc/boxed.rs
parentb497f050081886803682adc081ddb1e8c4a59a57 (diff)
downloadrust-24a8ef63ff786dd702d428f73fd64aac2a828f19.tar.gz
rust-24a8ef63ff786dd702d428f73fd64aac2a828f19.zip
Move hash module from collections to core
Diffstat (limited to 'src/liballoc/boxed.rs')
-rw-r--r--src/liballoc/boxed.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs
index b0ba20b0133..c6afeb063fb 100644
--- a/src/liballoc/boxed.rs
+++ b/src/liballoc/boxed.rs
@@ -15,6 +15,7 @@ use core::clone::Clone;
 use core::cmp::{PartialEq, PartialOrd, Eq, Ord, Ordering};
 use core::default::Default;
 use core::fmt;
+use core::hash::{mod, Hash};
 use core::kinds::Sized;
 use core::mem;
 use core::option::Option;
@@ -93,6 +94,14 @@ impl<Sized? T: Ord> Ord for Box<T> {
 }
 impl<Sized? T: Eq> Eq for Box<T> {}
 
+impl<S: hash::Writer, Sized? T: Hash<S>> Hash<S> for Box<T> {
+    #[inline]
+    fn hash(&self, state: &mut S) {
+        (**self).hash(state);
+    }
+}
+
+
 /// Extension methods for an owning `Any` trait object.
 #[unstable = "post-DST and coherence changes, this will not be a trait but \
               rather a direct `impl` on `Box<Any>`"]