11error[E0277]: `std::sync::mpsc::Receiver<()>` cannot be shared between threads safely
2- --> $DIR/closure-move-sync.rs:7 :13
2+ --> $DIR/closure-move-sync.rs:10 :13
33 |
44LL | let t = thread::spawn(|| {
55 | ^^^^^^^^^^^^^ `std::sync::mpsc::Receiver<()>` cannot be shared between threads safely
@@ -11,10 +11,10 @@ LL | F: Send + 'static,
1111 |
1212 = help: the trait `std::marker::Sync` is not implemented for `std::sync::mpsc::Receiver<()>`
1313 = note: required because of the requirements on the impl of `std::marker::Send` for `&std::sync::mpsc::Receiver<()>`
14- = note: required because it appears within the type `[closure@$DIR/closure-move-sync.rs:7 :27: 10 :6 recv:&std::sync::mpsc::Receiver<()>]`
14+ = note: required because it appears within the type `[closure@$DIR/closure-move-sync.rs:10 :27: 13 :6 recv:&std::sync::mpsc::Receiver<()>]`
1515
1616error[E0277]: `std::sync::mpsc::Sender<()>` cannot be shared between threads safely
17- --> $DIR/closure-move-sync.rs:19 :5
17+ --> $DIR/closure-move-sync.rs:22 :5
1818 |
1919LL | thread::spawn(|| tx.send(()).unwrap());
2020 | ^^^^^^^^^^^^^ `std::sync::mpsc::Sender<()>` cannot be shared between threads safely
@@ -26,7 +26,7 @@ LL | F: Send + 'static,
2626 |
2727 = help: the trait `std::marker::Sync` is not implemented for `std::sync::mpsc::Sender<()>`
2828 = note: required because of the requirements on the impl of `std::marker::Send` for `&std::sync::mpsc::Sender<()>`
29- = note: required because it appears within the type `[closure@$DIR/closure-move-sync.rs:19 :19: 19 :42 tx:&std::sync::mpsc::Sender<()>]`
29+ = note: required because it appears within the type `[closure@$DIR/closure-move-sync.rs:22 :19: 22 :42 tx:&std::sync::mpsc::Sender<()>]`
3030
3131error: aborting due to 2 previous errors
3232
0 commit comments