@@ -662,20 +662,17 @@ impl<T> Arc<T> {
662662 ///
663663 /// This will succeed even if there are outstanding weak references.
664664 ///
665- // FIXME: when `Arc::into_inner` is stabilized, add this paragraph:
666- /*
667665 /// It is strongly recommended to use [`Arc::into_inner`] instead if you don't
668666 /// want to keep the `Arc` in the [`Err`] case.
669667 /// Immediately dropping the [`Err`] payload, like in the expression
670668 /// `Arc::try_unwrap(this).ok()`, can still cause the strong count to
671669 /// drop to zero and the inner value of the `Arc` to be dropped:
672- /// For instance if two threads execute this expression in parallel, then
670+ /// For instance if two threads each execute this expression in parallel, then
673671 /// there is a race condition. The threads could first both check whether they
674672 /// have the last clone of their `Arc` via `Arc::try_unwrap`, and then
675673 /// both drop their `Arc` in the call to [`ok`][`Result::ok`],
676674 /// taking the strong count from two down to zero.
677675 ///
678- */
679676 /// # Examples
680677 ///
681678 /// ```
@@ -719,20 +716,13 @@ impl<T> Arc<T> {
719716 /// This means in particular that the inner value is not dropped.
720717 ///
721718 /// The similar expression `Arc::try_unwrap(this).ok()` does not
722- /// offer such a guarantee. See the last example below.
723- //
724- // FIXME: when `Arc::into_inner` is stabilized, add this to end
725- // of the previous sentence:
726- /*
719+ /// offer such a guarantee. See the last example below
727720 /// and the documentation of [`Arc::try_unwrap`].
728- */
729721 ///
730722 /// # Examples
731723 ///
732724 /// Minimal example demonstrating the guarantee that `Arc::into_inner` gives.
733725 /// ```
734- /// #![feature(arc_into_inner)]
735- ///
736726 /// use std::sync::Arc;
737727 ///
738728 /// let x = Arc::new(3);
@@ -756,8 +746,6 @@ impl<T> Arc<T> {
756746 ///
757747 /// A more practical example demonstrating the need for `Arc::into_inner`:
758748 /// ```
759- /// #![feature(arc_into_inner)]
760- ///
761749 /// use std::sync::Arc;
762750 ///
763751 /// // Definition of a simple singly linked list using `Arc`:
@@ -807,13 +795,8 @@ impl<T> Arc<T> {
807795 /// x_thread.join().unwrap();
808796 /// y_thread.join().unwrap();
809797 /// ```
810-
811- // FIXME: when `Arc::into_inner` is stabilized, adjust above documentation
812- // and the documentation of `Arc::try_unwrap` according to the `FIXME`s. Also
813- // open an issue on rust-lang/rust-clippy, asking for a lint against
814- // `Arc::try_unwrap(...).ok()`.
815798 #[ inline]
816- #[ unstable ( feature = "arc_into_inner" , issue = "106894 " ) ]
799+ #[ stable ( feature = "arc_into_inner" , since = "CURRENT_RUSTC_VERSION " ) ]
817800 pub fn into_inner ( this : Self ) -> Option < T > {
818801 // Make sure that the ordinary `Drop` implementation isn’t called as well
819802 let mut this = mem:: ManuallyDrop :: new ( this) ;
0 commit comments