Skip to content

Commit 307804a

Browse files
committed
Update {rc, sync}::Weak::ptr_eq doc about comparing Weak::new
1 parent d86516d commit 307804a

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/liballoc/rc.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1832,8 +1832,9 @@ impl<T: ?Sized> Weak<T> {
18321832
}
18331833
}
18341834

1835-
/// Returns `true` if the two `Weak`s point to the same value (not just values
1836-
/// that compare as equal).
1835+
/// Returns `true` if the two `Weak`s point to the same value (not just
1836+
/// values that compare as equal), or if both don't point to any value
1837+
/// (because they were created with `Weak::new()`).
18371838
///
18381839
/// # Notes
18391840
///

src/liballoc/sync.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1550,15 +1550,15 @@ impl<T: ?Sized> Weak<T> {
15501550
}
15511551
}
15521552

1553-
/// Returns `true` if the two `Weak`s point to the same value (not just values
1554-
/// that compare as equal).
1553+
/// Returns `true` if the two `Weak`s point to the same value (not just
1554+
/// values that compare as equal), or if both don't point to any value
1555+
/// (because they were created with `Weak::new()`).
15551556
///
15561557
/// # Notes
15571558
///
15581559
/// Since this compares pointers it means that `Weak::new()` will equal each
15591560
/// other, even though they don't point to any value.
15601561
///
1561-
///
15621562
/// # Examples
15631563
///
15641564
/// ```

0 commit comments

Comments
 (0)