Skip to content

Commit 8a68b40

Browse files
committed
add test case for rust-lang#39364
1 parent 31dc5bb commit 8a68b40

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

library/std/src/sync/mpsc/tests.rs

+14
Original file line numberDiff line numberDiff line change
@@ -706,3 +706,17 @@ fn issue_32114() {
706706
let _ = tx.send(123);
707707
assert_eq!(tx.send(123), Err(SendError(123)));
708708
}
709+
710+
#[test]
711+
fn issue_39364() {
712+
let (tx, rx) = channel::<()>();
713+
let t = thread::spawn(move || {
714+
thread::sleep(Duration::from_millis(300));
715+
let _ = tx.clone();
716+
crate::mem::forget(tx);
717+
});
718+
719+
let _ = rx.recv_timeout(Duration::from_millis(500));
720+
t.join().unwrap();
721+
let _ = rx.recv_timeout(Duration::from_millis(500));
722+
}

0 commit comments

Comments
 (0)