@@ -1462,8 +1462,9 @@ impl<T> Weak<T> {
1462
1462
1463
1463
/// Consumes the `Weak<T>` and turns it into a raw pointer.
1464
1464
///
1465
- /// This converts the weak pointer into a raw pointer, preserving the original weak count. It
1466
- /// can be turned back into the `Weak<T>` with [`from_raw`].
1465
+ /// This converts the weak pointer into a raw pointer, while still preserving the ownership of
1466
+ /// one weak reference (the weak count is not modified by this operation). It can be turned
1467
+ /// back into the `Weak<T>` with [`from_raw`].
1467
1468
///
1468
1469
/// The same restrictions of accessing the target of the pointer as with
1469
1470
/// [`as_ptr`] apply.
@@ -1493,24 +1494,23 @@ impl<T> Weak<T> {
1493
1494
result
1494
1495
}
1495
1496
1496
- /// Converts a raw pointer previously created by [`into_raw`] back into
1497
- /// `Weak<T>`.
1497
+ /// Converts a raw pointer previously created by [`into_raw`] back into `Weak<T>`.
1498
1498
///
1499
1499
/// This can be used to safely get a strong reference (by calling [`upgrade`]
1500
1500
/// later) or to deallocate the weak count by dropping the `Weak<T>`.
1501
1501
///
1502
- /// It takes ownership of one weak count (with the exception of pointers created by [`new`],
1503
- /// as these don't have any corresponding weak count ).
1502
+ /// It takes ownership of one weak reference (with the exception of pointers created by [`new`],
1503
+ /// as these don't own anything; the method still works on them ).
1504
1504
///
1505
1505
/// # Safety
1506
1506
///
1507
1507
/// The pointer must have originated from the [`into_raw`] and must still own its potential
1508
- /// weak reference count.
1509
- ///
1510
- /// It is allowed for the strong count to be 0 at the time of calling this, but the weak count
1511
- /// must be non-zero or the pointer must have originated from a dangling `Weak<T>` (one created
1512
- /// by [`new`]).
1508
+ /// weak reference.
1513
1509
///
1510
+ /// It is allowed for the strong count to be 0 at the time of calling this. Nevertheless, this
1511
+ /// takes ownership of one weak reference currently represented as a raw pointer (the weak
1512
+ /// count is not modified by this operation) and therefore it must be paired with a previous
1513
+ /// call to [`into_raw`].
1514
1514
/// # Examples
1515
1515
///
1516
1516
/// ```
0 commit comments