]> git.proxmox.com Git - rustc.git/blob - src/test/ui/closures/closure-move-sync.rs
New upstream version 1.42.0+dfsg1
[rustc.git] / src / test / ui / closures / closure-move-sync.rs
1 // FIXME: missing sysroot spans (#53081)
2 // ignore-i586-unknown-linux-gnu
3 // ignore-i586-unknown-linux-musl
4 // ignore-i686-unknown-linux-musl
5 use std::thread;
6 use std::sync::mpsc::channel;
7
8 fn bar() {
9 let (send, recv) = channel();
10 let t = thread::spawn(|| {
11 recv.recv().unwrap();
12 //~^^ ERROR `std::sync::mpsc::Receiver<()>` cannot be shared between threads safely
13 });
14
15 send.send(());
16
17 t.join().unwrap();
18 }
19
20 fn foo() {
21 let (tx, _rx) = channel();
22 thread::spawn(|| tx.send(()).unwrap());
23 //~^ ERROR `std::sync::mpsc::Sender<()>` cannot be shared between threads safely
24 }
25
26 fn main() {}