Skip to content

Elide lifetimes around Arc<T>. #16084

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/liballoc/arc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ impl<T: Share + Send> Arc<T> {
}

#[inline]
fn inner<'a>(&'a self) -> &'a ArcInner<T> {
fn inner(&self) -> &ArcInner<T> {
// This unsafety is ok because while this arc is alive we're guaranteed
// that the inner pointer is valid. Furthermore, we know that the
// `ArcInner` structure itself is `Share` because the inner data is
Expand Down Expand Up @@ -142,7 +142,7 @@ impl<T: Share + Send> Clone for Arc<T> {
#[experimental = "Deref is experimental."]
impl<T: Send + Share> Deref<T> for Arc<T> {
#[inline]
fn deref<'a>(&'a self) -> &'a T {
fn deref(&self) -> &T {
&self.inner().data
}
}
Expand All @@ -155,7 +155,7 @@ impl<T: Send + Share + Clone> Arc<T> {
/// data is cloned if the reference count is greater than one.
#[inline]
#[experimental]
pub fn make_unique<'a>(&'a mut self) -> &'a mut T {
pub fn make_unique(&mut self) -> &mut T {
// Note that we hold a strong reference, which also counts as
// a weak reference, so we only clone if there is an
// additional reference of either kind.
Expand Down Expand Up @@ -238,7 +238,7 @@ impl<T: Share + Send> Weak<T> {
}

#[inline]
fn inner<'a>(&'a self) -> &'a ArcInner<T> {
fn inner(&self) -> &ArcInner<T> {
// See comments above for why this is "safe"
unsafe { &*self._ptr }
}
Expand Down