diff options
| author | Simon Sapin <simon.sapin@exyr.org> | 2015-08-19 16:03:59 +0200 |
|---|---|---|
| committer | Simon Sapin <simon.sapin@exyr.org> | 2015-08-22 13:58:39 +0200 |
| commit | c408b7863389aa2bdb253ffa363e693bcd02439f (patch) | |
| tree | d24554daf2d34ade8df07a7a68c4a5ced316cf0b /src/liballoc/arc.rs | |
| parent | 94ee3b5a54a9f4965b82f5e4eda512966e96ac63 (diff) | |
| download | rust-c408b7863389aa2bdb253ffa363e693bcd02439f.tar.gz rust-c408b7863389aa2bdb253ffa363e693bcd02439f.zip | |
Move the Borrow and BorrowMut traits to libcore.
Diffstat (limited to 'src/liballoc/arc.rs')
| -rw-r--r-- | src/liballoc/arc.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs index bb2daa2a1d7..b68d7976540 100644 --- a/src/liballoc/arc.rs +++ b/src/liballoc/arc.rs @@ -73,6 +73,7 @@ use boxed::Box; use core::sync::atomic; use core::sync::atomic::Ordering::{Relaxed, Release, Acquire, SeqCst}; +use core::borrow; use core::fmt; use core::cmp::Ordering; use core::mem::{align_of_val, size_of_val}; @@ -1109,3 +1110,7 @@ mod tests { assert!(y.upgrade().is_none()); } } + +impl<T: ?Sized> borrow::Borrow<T> for Arc<T> { + fn borrow(&self) -> &T { &**self } +} |
