]> git.lizzy.rs Git - rust.git/blob - src/test/ui/closures/closure-move-sync.stderr
Rollup merge of #101774 - Riolku:atomic-update-aba, r=m-ou-se
[rust.git] / src / test / ui / closures / closure-move-sync.stderr
1 error[E0277]: `std::sync::mpsc::Receiver<()>` cannot be shared between threads safely
2   --> $DIR/closure-move-sync.rs:6:27
3    |
4 LL |       let t = thread::spawn(|| {
5    |  _____________-------------_^
6    | |             |
7    | |             required by a bound introduced by this call
8 LL | |         recv.recv().unwrap();
9 LL | |
10 LL | |     });
11    | |_____^ `std::sync::mpsc::Receiver<()>` cannot be shared between threads safely
12    |
13    = help: the trait `Sync` is not implemented for `std::sync::mpsc::Receiver<()>`
14    = note: required for `&std::sync::mpsc::Receiver<()>` to implement `Send`
15 note: required because it's used within this closure
16   --> $DIR/closure-move-sync.rs:6:27
17    |
18 LL |     let t = thread::spawn(|| {
19    |                           ^^
20 note: required by a bound in `spawn`
21   --> $SRC_DIR/std/src/thread/mod.rs:LL:COL
22    |
23 LL |     F: Send + 'static,
24    |        ^^^^ required by this bound in `spawn`
25
26 error[E0277]: `Sender<()>` cannot be shared between threads safely
27   --> $DIR/closure-move-sync.rs:18:19
28    |
29 LL |     thread::spawn(|| tx.send(()).unwrap());
30    |     ------------- ^^^^^^^^^^^^^^^^^^^^^^^ `Sender<()>` cannot be shared between threads safely
31    |     |
32    |     required by a bound introduced by this call
33    |
34    = help: the trait `Sync` is not implemented for `Sender<()>`
35    = note: required for `&Sender<()>` to implement `Send`
36 note: required because it's used within this closure
37   --> $DIR/closure-move-sync.rs:18:19
38    |
39 LL |     thread::spawn(|| tx.send(()).unwrap());
40    |                   ^^
41 note: required by a bound in `spawn`
42   --> $SRC_DIR/std/src/thread/mod.rs:LL:COL
43    |
44 LL |     F: Send + 'static,
45    |        ^^^^ required by this bound in `spawn`
46
47 error: aborting due to 2 previous errors
48
49 For more information about this error, try `rustc --explain E0277`.