1
1
error[E0277]: `std::sync::mpsc::Receiver<()>` cannot be shared between threads safely
2
2
--> $DIR/closure-move-sync.rs:16:13
3
3
|
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
6
6
|
7
7
= help: the trait `std::marker::Sync` is not implemented for `std::sync::mpsc::Receiver<()>`
8
8
= 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
12
12
error[E0277]: `std::sync::mpsc::Sender<()>` cannot be shared between threads safely
13
13
--> $DIR/closure-move-sync.rs:28:5
14
14
|
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
17
17
|
18
18
= help: the trait `std::marker::Sync` is not implemented for `std::sync::mpsc::Sender<()>`
19
19
= 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
22
22
23
23
error: aborting due to 2 previous errors
24
24
25
+ If you want more information on this error, try using "rustc --explain E0277"
0 commit comments