diff options
Diffstat (limited to 'src/liballoc/arc.rs')
| -rw-r--r-- | src/liballoc/arc.rs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs index 3830d7fe295..934e6ab2159 100644 --- a/src/liballoc/arc.rs +++ b/src/liballoc/arc.rs @@ -73,7 +73,6 @@ use core::prelude::*; use core::atomic; use core::atomic::Ordering::{Relaxed, Release, Acquire, SeqCst}; -use core::borrow::BorrowFrom; use core::fmt; use core::cmp::{Ordering}; use core::default::Default; @@ -244,12 +243,6 @@ impl<T> Clone for Arc<T> { } } -impl<T> BorrowFrom<Arc<T>> for T { - fn borrow_from(owned: &Arc<T>) -> &T { - &**owned - } -} - #[stable(feature = "rust1", since = "1.0.0")] impl<T> Deref for Arc<T> { type Target = T; @@ -605,11 +598,19 @@ impl<T: Default + Sync + Send> Default for Arc<T> { fn default() -> Arc<T> { Arc::new(Default::default()) } } +#[cfg(stage0)] impl<H: Hasher, T: Hash<H>> Hash<H> for Arc<T> { fn hash(&self, state: &mut H) { (**self).hash(state) } } +#[cfg(not(stage0))] +#[stable(feature = "rust1", since = "1.0.0")] +impl<T: Hash> Hash for Arc<T> { + fn hash<H: Hasher>(&self, state: &mut H) { + (**self).hash(state) + } +} #[cfg(test)] mod tests { |
