11error[E0277]: `std::sync::mpsc::Receiver<()>` cannot be shared between threads safely
22 --> $DIR/closure-move-sync.rs:16:13
33 |
4- 16 | let t = thread::spawn(|| {
5- | ^^^^^^^^^^^^^ `std::sync::mpsc::Receiver<()>` cannot be shared safely, consider marking the closure `move`
4+ LL | let t = thread::spawn(|| {
5+ | ^^^^^^^^^^^^^ `std::sync::mpsc::Receiver<()>` cannot be shared between threads safely
66 |
77 = help: the trait `std::marker::Sync` is not implemented for `std::sync::mpsc::Receiver<()>`
88 = note: required because of the requirements on the impl of `std::marker::Send` for `&std::sync::mpsc::Receiver<()>`
@@ -12,8 +12,8 @@ error[E0277]: `std::sync::mpsc::Receiver<()>` cannot be shared between threads s
1212error[E0277]: `std::sync::mpsc::Sender<()>` cannot be shared between threads safely
1313 --> $DIR/closure-move-sync.rs:28:5
1414 |
15- 28 | thread::spawn(|| tx.send(()).unwrap());
16- | ^^^^^^^^^^^^^ `std::sync::mpsc::Sender<()>` cannot be shared safely, consider marking the closure `move`
15+ LL | thread::spawn(|| tx.send(()).unwrap());
16+ | ^^^^^^^^^^^^^ `std::sync::mpsc::Sender<()>` cannot be shared between threads safely
1717 |
1818 = help: the trait `std::marker::Sync` is not implemented for `std::sync::mpsc::Sender<()>`
1919 = note: required because of the requirements on the impl of `std::marker::Send` for `&std::sync::mpsc::Sender<()>`
@@ -22,3 +22,4 @@ error[E0277]: `std::sync::mpsc::Sender<()>` cannot be shared between threads saf
2222
2323error: aborting due to 2 previous errors
2424
25+ If you want more information on this error, try using "rustc --explain E0277"
0 commit comments