]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #26160 - alexcrichton:revert-rc-as-ref, r=aturon
authorbors <bors@rust-lang.org>
Fri, 12 Jun 2015 23:05:06 +0000 (23:05 +0000)
committerbors <bors@rust-lang.org>
Fri, 12 Jun 2015 23:05:06 +0000 (23:05 +0000)
This is a revert of PR #26008 which caused the unintended breakage reported in #26096. We may want to add these implementations in the long run, but for now this revert allows us to take some more time to evaluate the impact of such a change (e.g. run it through crater).

Closes #26096

src/liballoc/arc.rs
src/liballoc/rc.rs

index 990a73c53ae966b417dff746909575492fc7810f..616071f0df709267af011b593ec8a14d66d8c9c4 100644 (file)
@@ -330,15 +330,6 @@ fn deref(&self) -> &T {
     }
 }
 
-#[stable(feature = "rc_arc_as_ref", since = "1.2.0")]
-impl<T: ?Sized> AsRef<T> for Arc<T> {
-
-    #[inline]
-    fn as_ref(&self) -> &T {
-        &self.inner().data
-    }
-}
-
 impl<T: Clone> Arc<T> {
     /// Make a mutable reference from the given `Arc<T>`.
     ///
index 906a41a4d531410f810da7c1f22902ca37eb23d0..44f4a6a6290c8e04ae12ebd96416921c83a8043a 100644 (file)
 use core::cell::Cell;
 use core::clone::Clone;
 use core::cmp::{PartialEq, PartialOrd, Eq, Ord, Ordering};
-use core::convert::AsRef;
 use core::default::Default;
 use core::fmt;
 use core::hash::{Hasher, Hash};
@@ -380,15 +379,6 @@ fn deref(&self) -> &T {
     }
 }
 
-#[stable(feature = "rc_arc_as_ref", since = "1.2.0")]
-impl<T: ?Sized> AsRef<T> for Rc<T> {
-
-    #[inline(always)]
-    fn as_ref(&self) -> &T {
-        &self.inner().value
-    }
-}
-
 #[stable(feature = "rust1", since = "1.0.0")]
 impl<T: ?Sized> Drop for Rc<T> {
     /// Drops the `Rc<T>`.