Skip to content

Commit ac6cd90

Browse files
committed
Explain why immediately dropping a JoinGuard is not what you want to do
1 parent cfea8ec commit ac6cd90

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libstd/thread.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ impl Drop for JoinHandle {
635635
/// Due to platform restrictions, it is not possible to `Clone` this
636636
/// handle: the ability to join a child thread is a uniquely-owned
637637
/// permission.
638-
#[must_use]
638+
#[must_use = "thread will be immediately joined if `JoinGuard` is not used"]
639639
#[stable(feature = "rust1", since = "1.0.0")]
640640
pub struct JoinGuard<'a, T: 'a> {
641641
inner: JoinInner<T>,

0 commit comments

Comments
 (0)