File tree 2 files changed +4
-2
lines changed
2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -252,6 +252,7 @@ pub fn strong_count<T>(this: &Arc<T>) -> usize { this.inner().strong.load(SeqCst
252
252
/// ```
253
253
/// # #![feature(alloc)]
254
254
/// extern crate alloc;
255
+ /// # fn main() {
255
256
/// use alloc::arc::{Arc, get_mut};
256
257
///
257
258
/// let mut x = Arc::new(3);
@@ -260,10 +261,11 @@ pub fn strong_count<T>(this: &Arc<T>) -> usize { this.inner().strong.load(SeqCst
260
261
///
261
262
/// let _y = x.clone();
262
263
/// assert!(get_mut(&mut x).is_none());
264
+ /// # }
263
265
/// ```
264
266
#[ inline]
265
267
#[ unstable( feature = "alloc" ) ]
266
- pub fn get_mut < ' a , T > ( this : & ' a mut Arc < T > ) -> Option < & ' a mut T > {
268
+ pub fn get_mut < T > ( this : & mut Arc < T > ) -> Option < & mut T > {
267
269
if strong_count ( this) == 1 && weak_count ( this) == 0 {
268
270
// This unsafety is ok because we're guaranteed that the pointer
269
271
// returned is the *only* pointer that will ever be returned to T. Our
Original file line number Diff line number Diff line change @@ -324,7 +324,7 @@ pub fn try_unwrap<T>(rc: Rc<T>) -> Result<T, Rc<T>> {
324
324
/// ```
325
325
#[ inline]
326
326
#[ unstable( feature = "alloc" ) ]
327
- pub fn get_mut < ' a , T > ( rc : & ' a mut Rc < T > ) -> Option < & ' a mut T > {
327
+ pub fn get_mut < T > ( rc : & mut Rc < T > ) -> Option < & mut T > {
328
328
if is_unique ( rc) {
329
329
let inner = unsafe { & mut * * rc. _ptr } ;
330
330
Some ( & mut inner. value )
You can’t perform that action at this time.
0 commit comments