Skip to content

Commit c6b1483

Browse files
committed
Auto merge of #26160 - alexcrichton:revert-rc-as-ref, r=aturon
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
2 parents 50ab23d + 9d6ffbd commit c6b1483

File tree

2 files changed

+0
-19
lines changed

2 files changed

+0
-19
lines changed

src/liballoc/arc.rs

-9
Original file line numberDiff line numberDiff line change
@@ -330,15 +330,6 @@ impl<T: ?Sized> Deref for Arc<T> {
330330
}
331331
}
332332

333-
#[stable(feature = "rc_arc_as_ref", since = "1.2.0")]
334-
impl<T: ?Sized> AsRef<T> for Arc<T> {
335-
336-
#[inline]
337-
fn as_ref(&self) -> &T {
338-
&self.inner().data
339-
}
340-
}
341-
342333
impl<T: Clone> Arc<T> {
343334
/// Make a mutable reference from the given `Arc<T>`.
344335
///

src/liballoc/rc.rs

-10
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ use std::boxed;
156156
use core::cell::Cell;
157157
use core::clone::Clone;
158158
use core::cmp::{PartialEq, PartialOrd, Eq, Ord, Ordering};
159-
use core::convert::AsRef;
160159
use core::default::Default;
161160
use core::fmt;
162161
use core::hash::{Hasher, Hash};
@@ -380,15 +379,6 @@ impl<T: ?Sized> Deref for Rc<T> {
380379
}
381380
}
382381

383-
#[stable(feature = "rc_arc_as_ref", since = "1.2.0")]
384-
impl<T: ?Sized> AsRef<T> for Rc<T> {
385-
386-
#[inline(always)]
387-
fn as_ref(&self) -> &T {
388-
&self.inner().value
389-
}
390-
}
391-
392382
#[stable(feature = "rust1", since = "1.0.0")]
393383
impl<T: ?Sized> Drop for Rc<T> {
394384
/// Drops the `Rc<T>`.

0 commit comments

Comments
 (0)