]> git.proxmox.com Git - rustc.git/blob - src/test/ui/generator/print/generator-print-verbose-2.stderr
1356fa5f15295db37399e3eff7463df577b4761c
[rustc.git] / src / test / ui / generator / print / generator-print-verbose-2.stderr
1 error[E0277]: `Cell<i32>` cannot be shared between threads safely
2 --> $DIR/generator-print-verbose-2.rs:19:5
3 |
4 LL | assert_send(|| {
5 | ^^^^^^^^^^^ `Cell<i32>` cannot be shared between threads safely
6 |
7 = help: the trait `Sync` is not implemented for `Cell<i32>`
8 = note: required because of the requirements on the impl of `Send` for `&'_#4r Cell<i32>`
9 note: required because it's used within this generator
10 --> $DIR/generator-print-verbose-2.rs:19:17
11 |
12 LL | assert_send(|| {
13 | _________________^
14 LL | |
15 LL | | drop(&a);
16 LL | | yield;
17 LL | | });
18 | |_____^
19 note: required by a bound in `assert_send`
20 --> $DIR/generator-print-verbose-2.rs:10:23
21 |
22 LL | fn assert_send<T: Send>(_: T) {}
23 | ^^^^ required by this bound in `assert_send`
24
25 error: generator cannot be shared between threads safely
26 --> $DIR/generator-print-verbose-2.rs:12:5
27 |
28 LL | assert_sync(|| {
29 | ^^^^^^^^^^^ generator is not `Sync`
30 |
31 = help: within `[main::{closure#0} upvar_tys=() {Cell<i32>, ()}]`, the trait `Sync` is not implemented for `Cell<i32>`
32 note: generator is not `Sync` as this value is used across a yield
33 --> $DIR/generator-print-verbose-2.rs:15:9
34 |
35 LL | let a = Cell::new(2);
36 | - has type `Cell<i32>` which is not `Sync`
37 LL | yield;
38 | ^^^^^ yield occurs here, with `a` maybe used later
39 LL | });
40 | - `a` is later dropped here
41 note: required by a bound in `assert_sync`
42 --> $DIR/generator-print-verbose-2.rs:9:23
43 |
44 LL | fn assert_sync<T: Sync>(_: T) {}
45 | ^^^^ required by this bound in `assert_sync`
46
47 error: aborting due to 2 previous errors
48
49 For more information about this error, try `rustc --explain E0277`.