]> git.lizzy.rs Git - rust.git/blob - tests/ui/closures/closure-move-sync.stderr
Rollup merge of #107700 - jyn514:tools-builder, r=Mark-Simulacrum
[rust.git] / tests / 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 error[E0277]: `Sender<()>` cannot be shared between threads safely
24   --> $DIR/closure-move-sync.rs:18:19
25    |
26 LL |     thread::spawn(|| tx.send(()).unwrap());
27    |     ------------- ^^^^^^^^^^^^^^^^^^^^^^^ `Sender<()>` cannot be shared between threads safely
28    |     |
29    |     required by a bound introduced by this call
30    |
31    = help: the trait `Sync` is not implemented for `Sender<()>`
32    = note: required for `&Sender<()>` to implement `Send`
33 note: required because it's used within this closure
34   --> $DIR/closure-move-sync.rs:18:19
35    |
36 LL |     thread::spawn(|| tx.send(()).unwrap());
37    |                   ^^
38 note: required by a bound in `spawn`
39   --> $SRC_DIR/std/src/thread/mod.rs:LL:COL
40
41 error: aborting due to 2 previous errors
42
43 For more information about this error, try `rustc --explain E0277`.