diff --git a/src/liballoc/rc.rs b/src/liballoc/rc.rs index 53891583edb20..217c898e661a0 100644 --- a/src/liballoc/rc.rs +++ b/src/liballoc/rc.rs @@ -141,6 +141,7 @@ #![stable] +use core::borrow::BorrowFrom; use core::cell::Cell; use core::clone::Clone; use core::cmp::{PartialEq, PartialOrd, Eq, Ord, Ordering}; @@ -349,6 +350,12 @@ impl Rc { } } +impl BorrowFrom> for T { + fn borrow_from(owned: &Rc) -> &T { + &**owned + } +} + #[experimental = "Deref is experimental."] impl Deref for Rc { #[inline(always)]