blob: 3ee2b35f59fccca67dcbd2cb0e300e4b158217c8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
use std::thread;
use std::sync::mpsc::channel;
fn bar() {
let (send, recv) = channel();
let t = thread::spawn(|| {
recv.recv().unwrap();
//~^^ ERROR `std::sync::mpsc::Receiver<()>` cannot be shared between threads safely
});
send.send(());
t.join().unwrap();
}
fn main() {}
|