about summary refs log tree commit diff
path: root/src/liballoc/arc.rs
diff options
context:
space:
mode:
authorDzmitry Malyshau <kvarkus@gmail.com>2015-04-04 18:54:23 -0400
committerDzmitry Malyshau <kvarkus@gmail.com>2015-04-04 19:01:48 -0400
commitbc1aef3e7b46db3d3eee4eca80f6462f8a56bbeb (patch)
treeb56787f557ac9be3162d31e3f2369c5f01854382 /src/liballoc/arc.rs
parentc1d716ed4b98457fe6b713085ec3598c36aadadd (diff)
downloadrust-bc1aef3e7b46db3d3eee4eca80f6462f8a56bbeb.tar.gz
rust-bc1aef3e7b46db3d3eee4eca80f6462f8a56bbeb.zip
Removed explicit lifetimes for `get_mut`. Fixed the doc test.
Diffstat (limited to 'src/liballoc/arc.rs')
-rw-r--r--src/liballoc/arc.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs
index 0a66327b5ac..68bde147611 100644
--- a/src/liballoc/arc.rs
+++ b/src/liballoc/arc.rs
@@ -252,6 +252,7 @@ pub fn strong_count<T>(this: &Arc<T>) -> usize { this.inner().strong.load(SeqCst
 /// ```
 /// # #![feature(alloc)]
 /// extern crate alloc;
+/// # fn main() {
 /// use alloc::arc::{Arc, get_mut};
 ///
 /// let mut x = Arc::new(3);
@@ -260,10 +261,11 @@ pub fn strong_count<T>(this: &Arc<T>) -> usize { this.inner().strong.load(SeqCst
 ///
 /// let _y = x.clone();
 /// assert!(get_mut(&mut x).is_none());
+/// # }
 /// ```
 #[inline]
 #[unstable(feature = "alloc")]
-pub fn get_mut<'a, T>(this: &'a mut Arc<T>) -> Option<&'a mut T> {
+pub fn get_mut<T>(this: &mut Arc<T>) -> Option<&mut T> {
     if strong_count(this) == 1 && weak_count(this) == 0 {
         // This unsafety is ok because we're guaranteed that the pointer
         // returned is the *only* pointer that will ever be returned to T. Our