Skip to content

Commit

Permalink
add test case for rust-lang#39364
Browse files Browse the repository at this point in the history
  • Loading branch information
ibraheemdev committed Nov 10, 2022
1 parent 31dc5bb commit 8a68b40
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions library/std/src/sync/mpsc/tests.rs
Original file line number Diff line number Diff line change
@@ -706,3 +706,17 @@ fn issue_32114() {
let _ = tx.send(123);
assert_eq!(tx.send(123), Err(SendError(123)));
}

#[test]
fn issue_39364() {
let (tx, rx) = channel::<()>();
let t = thread::spawn(move || {
thread::sleep(Duration::from_millis(300));
let _ = tx.clone();
crate::mem::forget(tx);
});

let _ = rx.recv_timeout(Duration::from_millis(500));
t.join().unwrap();
let _ = rx.recv_timeout(Duration::from_millis(500));
}

0 comments on commit 8a68b40

Please sign in to comment.