File tree 1 file changed +7
-1
lines changed
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -485,6 +485,8 @@ impl<T> Arc<T> {
485
485
///
486
486
/// This will succeed even if there are outstanding weak references.
487
487
///
488
+ // FIXME: when `Arc::unwrap_or_drop` is stabilized, add this paragraph:
489
+ /*
488
490
/// It is strongly recommended to use [`Arc::unwrap_or_drop`] instead if you don't
489
491
/// want to keep the `Arc` in the [`Err`] case.
490
492
/// Immediately dropping the [`Err`] payload, like in the expression
@@ -496,6 +498,7 @@ impl<T> Arc<T> {
496
498
/// both drop their `Arc` in the call to [`ok`][`Result::ok`],
497
499
/// taking the strong count from two down to zero.
498
500
///
501
+ */
499
502
/// # Examples
500
503
///
501
504
/// ```
@@ -621,11 +624,14 @@ impl<T> Arc<T> {
621
624
/// t2.join().unwrap();
622
625
/// }
623
626
/// ```
627
+
628
+ // FIXME: when `Arc::unwrap_or_drop` is stabilized, adjust the documentation of
629
+ // `Arc::try_unwrap` according to the `FIXME` presented there.
624
630
#[ inline]
625
631
#[ unstable( feature = "unwrap_or_drop" , issue = "none" ) ] // FIXME: add issue
626
632
pub fn unwrap_or_drop ( this : Self ) -> Option < T > {
627
633
// Make sure that the ordinary `Drop` implementation isn’t called as well
628
- let mut this = core :: mem:: ManuallyDrop :: new ( this) ;
634
+ let mut this = mem:: ManuallyDrop :: new ( this) ;
629
635
630
636
// Following the implementation of `drop` and `drop_slow`
631
637
if this. inner ( ) . strong . fetch_sub ( 1 , Release ) != 1 {
You can’t perform that action at this time.
0 commit comments