Skip to content

Commit 02d12e5

Browse files
omasanorialexcrichton
authored andcommitted
Elide lifetimes around Arc<T>.
It's a small step forward in application of RFC 39 to the code base itself. Signed-off-by: OGINO Masanori <[email protected]>
1 parent 04fa906 commit 02d12e5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/liballoc/arc.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ impl<T: Share + Send> Arc<T> {
9292
}
9393

9494
#[inline]
95-
fn inner<'a>(&'a self) -> &'a ArcInner<T> {
95+
fn inner(&self) -> &ArcInner<T> {
9696
// This unsafety is ok because while this arc is alive we're guaranteed
9797
// that the inner pointer is valid. Furthermore, we know that the
9898
// `ArcInner` structure itself is `Share` because the inner data is
@@ -142,7 +142,7 @@ impl<T: Share + Send> Clone for Arc<T> {
142142
#[experimental = "Deref is experimental."]
143143
impl<T: Send + Share> Deref<T> for Arc<T> {
144144
#[inline]
145-
fn deref<'a>(&'a self) -> &'a T {
145+
fn deref(&self) -> &T {
146146
&self.inner().data
147147
}
148148
}
@@ -155,7 +155,7 @@ impl<T: Send + Share + Clone> Arc<T> {
155155
/// data is cloned if the reference count is greater than one.
156156
#[inline]
157157
#[experimental]
158-
pub fn make_unique<'a>(&'a mut self) -> &'a mut T {
158+
pub fn make_unique(&mut self) -> &mut T {
159159
// Note that we hold a strong reference, which also counts as
160160
// a weak reference, so we only clone if there is an
161161
// additional reference of either kind.
@@ -238,7 +238,7 @@ impl<T: Share + Send> Weak<T> {
238238
}
239239

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

0 commit comments

Comments
 (0)