]>
Commit | Line | Data |
---|---|---|
0531ce1d XL |
1 | use std::thread; |
2 | use std::sync::mpsc::channel; | |
3 | ||
4 | fn bar() { | |
5 | let (send, recv) = channel(); | |
6 | let t = thread::spawn(|| { | |
7 | recv.recv().unwrap(); | |
8 | //~^^ ERROR `std::sync::mpsc::Receiver<()>` cannot be shared between threads safely | |
9 | }); | |
10 | ||
11 | send.send(()); | |
12 | ||
13 | t.join().unwrap(); | |
14 | } | |
15 | ||
16 | fn foo() { | |
17 | let (tx, _rx) = channel(); | |
18 | thread::spawn(|| tx.send(()).unwrap()); | |
19 | //~^ ERROR `std::sync::mpsc::Sender<()>` cannot be shared between threads safely | |
20 | } | |
21 | ||
abe05a73 | 22 | fn main() {} |