about summary refs log tree commit diff
path: root/src/liballoc
diff options
context:
space:
mode:
Diffstat (limited to 'src/liballoc')
-rw-r--r--src/liballoc/arc.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs
index 1f1909fd33c..e419d4b0041 100644
--- a/src/liballoc/arc.rs
+++ b/src/liballoc/arc.rs
@@ -14,6 +14,7 @@
 //! between tasks.
 
 use core::atomic;
+use core::borrow::BorrowFrom;
 use core::clone::Clone;
 use core::fmt::{mod, Show};
 use core::cmp::{Eq, Ord, PartialEq, PartialOrd, Ordering};
@@ -155,6 +156,12 @@ impl<T> Clone for Arc<T> {
     }
 }
 
+impl<T> BorrowFrom<Arc<T>> for T {
+    fn borrow_from(owned: &Arc<T>) -> &T {
+        &**owned
+    }
+}
+
 #[experimental = "Deref is experimental."]
 impl<T> Deref<T> for Arc<T> {
     #[inline]