]> git.proxmox.com Git - rustc.git/blame - src/test/ui/closures/closure-move-sync.rs
New upstream version 1.44.1+dfsg1
[rustc.git] / src / test / ui / closures / closure-move-sync.rs
CommitLineData
0531ce1d
XL
1use std::thread;
2use std::sync::mpsc::channel;
3
4fn 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
16fn 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 22fn main() {}