]> git.lizzy.rs Git - rust.git/blob - src/test/ui/no-send-res-ports.stderr
Auto merge of #98190 - nnethercote:optimize-derive-Debug-code, r=scottmcm
[rust.git] / src / test / ui / no-send-res-ports.stderr
1 error[E0277]: `Rc<()>` cannot be sent between threads safely
2   --> $DIR/no-send-res-ports.rs:25:5
3    |
4 LL |       thread::spawn(move|| {
5    |  _____^^^^^^^^^^^^^_-
6    | |     |
7    | |     `Rc<()>` cannot be sent between threads safely
8 LL | |
9 LL | |         let y = x;
10 LL | |         println!("{:?}", y);
11 LL | |     });
12    | |_____- within this `[closure@$DIR/no-send-res-ports.rs:25:19: 29:6]`
13    |
14    = help: within `[closure@$DIR/no-send-res-ports.rs:25:19: 29:6]`, the trait `Send` is not implemented for `Rc<()>`
15 note: required because it appears within the type `Port<()>`
16   --> $DIR/no-send-res-ports.rs:5:8
17    |
18 LL | struct Port<T>(Rc<T>);
19    |        ^^^^
20 note: required because it appears within the type `Foo`
21   --> $DIR/no-send-res-ports.rs:9:12
22    |
23 LL |     struct Foo {
24    |            ^^^
25 note: required because it's used within this closure
26   --> $DIR/no-send-res-ports.rs:25:19
27    |
28 LL |       thread::spawn(move|| {
29    |  ___________________^
30 LL | |
31 LL | |         let y = x;
32 LL | |         println!("{:?}", y);
33 LL | |     });
34    | |_____^
35 note: required by a bound in `spawn`
36   --> $SRC_DIR/std/src/thread/mod.rs:LL:COL
37    |
38 LL |     F: Send + 'static,
39    |        ^^^^ required by this bound in `spawn`
40
41 error: aborting due to previous error
42
43 For more information about this error, try `rustc --explain E0277`.