diff options
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 } +} |
