Revert "Added AsRef implementations for Arc and Rc"
This reverts commit 7f3ae0aa26.
This commit is contained in:
@@ -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> {
|
impl<T: Clone> Arc<T> {
|
||||||
/// Make a mutable reference from the given `Arc<T>`.
|
/// Make a mutable reference from the given `Arc<T>`.
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -156,7 +156,6 @@ use std::boxed;
|
|||||||
use core::cell::Cell;
|
use core::cell::Cell;
|
||||||
use core::clone::Clone;
|
use core::clone::Clone;
|
||||||
use core::cmp::{PartialEq, PartialOrd, Eq, Ord, Ordering};
|
use core::cmp::{PartialEq, PartialOrd, Eq, Ord, Ordering};
|
||||||
use core::convert::AsRef;
|
|
||||||
use core::default::Default;
|
use core::default::Default;
|
||||||
use core::fmt;
|
use core::fmt;
|
||||||
use core::hash::{Hasher, Hash};
|
use core::hash::{Hasher, Hash};
|
||||||
@@ -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")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
impl<T: ?Sized> Drop for Rc<T> {
|
impl<T: ?Sized> Drop for Rc<T> {
|
||||||
/// Drops the `Rc<T>`.
|
/// Drops the `Rc<T>`.
|
||||||
|
|||||||
Reference in New Issue
Block a user