@@ -485,9 +485,9 @@ impl<T> Arc<T> {
485485 ///
486486 /// This will succeed even if there are outstanding weak references.
487487 ///
488- // FIXME: when `Arc::unwrap_or_drop ` is stabilized, add this paragraph:
488+ // FIXME: when `Arc::into_inner ` is stabilized, add this paragraph:
489489 /*
490- /// It is strongly recommended to use [`Arc::unwrap_or_drop `] instead if you don't
490+ /// It is strongly recommended to use [`Arc::into_inner `] instead if you don't
491491 /// want to keep the `Arc` in the [`Err`] case.
492492 /// Immediately dropping the [`Err`] payload, like in the expression
493493 /// `Arc::try_unwrap(this).ok()`, can still cause the strong count to
@@ -537,7 +537,7 @@ impl<T> Arc<T> {
537537 ///
538538 /// This will succeed even if there are outstanding weak references.
539539 ///
540- /// If `unwrap_or_drop ` is called on every clone of this `Arc`,
540+ /// If `into_inner ` is called on every clone of this `Arc`,
541541 /// it is guaranteed that exactly one of the calls returns the inner value.
542542 /// This means in particular that the inner value is not dropped.
543543 ///
@@ -547,18 +547,18 @@ impl<T> Arc<T> {
547547 ///
548548 /// # Examples
549549 ///
550- /// Minimal example demonstrating the guarantee that `unwrap_or_drop ` gives.
550+ /// Minimal example demonstrating the guarantee that `into_inner ` gives.
551551 /// ```
552- /// #![feature(unwrap_or_drop )]
552+ /// #![feature(arc_into_inner )]
553553 ///
554554 /// use std::sync::Arc;
555555 ///
556556 /// let x = Arc::new(3);
557557 /// let y = Arc::clone(&x);
558558 ///
559- /// // Two threads calling `unwrap_or_drop ` on both clones of an `Arc`:
560- /// let x_unwrap_thread = std::thread::spawn(|| Arc::unwrap_or_drop (x));
561- /// let y_unwrap_thread = std::thread::spawn(|| Arc::unwrap_or_drop (y));
559+ /// // Two threads calling `into_inner ` on both clones of an `Arc`:
560+ /// let x_unwrap_thread = std::thread::spawn(|| Arc::into_inner (x));
561+ /// let y_unwrap_thread = std::thread::spawn(|| Arc::into_inner (y));
562562 ///
563563 /// let x_unwrapped_value = x_unwrap_thread.join().unwrap();
564564 /// let y_unwrapped_value = y_unwrap_thread.join().unwrap();
@@ -572,9 +572,9 @@ impl<T> Arc<T> {
572572 /// // `Arc::try_unwrap(x).ok()` and `Arc::try_unwrap(y).ok()` instead.
573573 /// ```
574574 ///
575- /// A more practical example demonstrating the need for `unwrap_or_drop `:
575+ /// A more practical example demonstrating the need for `into_inner `:
576576 /// ```
577- /// #![feature(unwrap_or_drop )]
577+ /// #![feature(arc_into_inner )]
578578 ///
579579 /// use std::sync::Arc;
580580 ///
@@ -590,7 +590,7 @@ impl<T> Arc<T> {
590590 /// fn drop(&mut self) {
591591 /// let mut x = self.0.take();
592592 /// while let Some(arc) = x.take() {
593- /// Arc::unwrap_or_drop (arc).map(|node| x = node.1);
593+ /// Arc::into_inner (arc).map(|node| x = node.1);
594594 /// }
595595 /// }
596596 /// }
@@ -608,7 +608,7 @@ impl<T> Arc<T> {
608608 ///
609609 /// // The following code could still cause a stack overflow
610610 /// // despite the manual `Drop` impl if that `Drop` impl used
611- /// // `Arc::try_unwrap(arc).ok()` instead of `Arc::unwrap_or_drop (arc)`.
611+ /// // `Arc::try_unwrap(arc).ok()` instead of `Arc::into_inner (arc)`.
612612 /// {
613613 /// // Create a long list and clone it
614614 /// let mut x = LinkedList::new();
@@ -625,11 +625,11 @@ impl<T> Arc<T> {
625625 /// }
626626 /// ```
627627
628- // FIXME: when `Arc::unwrap_or_drop ` is stabilized, adjust the documentation of
628+ // FIXME: when `Arc::into_inner ` is stabilized, adjust the documentation of
629629 // `Arc::try_unwrap` according to the `FIXME` presented there.
630630 #[ inline]
631- #[ unstable( feature = "unwrap_or_drop " , issue = "none" ) ] // FIXME: add issue
632- pub fn unwrap_or_drop ( this : Self ) -> Option < T > {
631+ #[ unstable( feature = "arc_into_inner " , issue = "none" ) ] // FIXME: create and add issue
632+ pub fn into_inner ( this : Self ) -> Option < T > {
633633 // Make sure that the ordinary `Drop` implementation isn’t called as well
634634 let mut this = mem:: ManuallyDrop :: new ( this) ;
635635
0 commit comments