rollup merge of #19642: aaronweiss74/master

This was discussed in [#rust-internals](
https://botbot.me/mozilla/rust-internals/2014-12-08/?msg=27077624&page=5). It's a small change.
This commit is contained in:
Alex Crichton 2014-12-09 09:25:12 -08:00
commit b4b1bb0a4e

View file

@ -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<T: Clone> Rc<T> {
}
}
impl<T> BorrowFrom<Rc<T>> for T {
fn borrow_from(owned: &Rc<T>) -> &T {
&**owned
}
}
#[experimental = "Deref is experimental."]
impl<T> Deref<T> for Rc<T> {
#[inline(always)]