Skip to content

Commit

Permalink
Auto merge of #26160 - alexcrichton:revert-rc-as-ref, r=aturon
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bors committed Jun 12, 2015
2 parents 50ab23d + 9d6ffbd commit c6b1483
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 19 deletions.
9 changes: 0 additions & 9 deletions src/liballoc/arc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,15 +330,6 @@ impl<T: ?Sized> Deref for Arc<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>`.
///
Expand Down
10 changes: 0 additions & 10 deletions src/liballoc/rc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ use std::boxed;
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};
Expand Down Expand Up @@ -380,15 +379,6 @@ impl<T: ?Sized> Deref for Rc<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>`.
Expand Down

0 comments on commit c6b1483

Please sign in to comment.