summaryrefslogtreecommitdiffstats
path: root/tests/ui/generator/not-send-sync.stderr
blob: a821c57b923a097bdb4770b167e6c568a6acbd51 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
error[E0277]: `Cell<i32>` cannot be shared between threads safely
  --> $DIR/not-send-sync.rs:16:17
   |
LL |       assert_send(|| {
   |  _____-----------_^
   | |     |
   | |     required by a bound introduced by this call
LL | |
LL | |         drop(&a);
LL | |         yield;
LL | |     });
   | |_____^ `Cell<i32>` cannot be shared between threads safely
   |
   = help: the trait `Sync` is not implemented for `Cell<i32>`
   = note: required for `&Cell<i32>` to implement `Send`
note: required because it's used within this generator
  --> $DIR/not-send-sync.rs:16:17
   |
LL |     assert_send(|| {
   |                 ^^
note: required by a bound in `assert_send`
  --> $DIR/not-send-sync.rs:7:23
   |
LL |     fn assert_send<T: Send>(_: T) {}
   |                       ^^^^ required by this bound in `assert_send`

error: generator cannot be shared between threads safely
  --> $DIR/not-send-sync.rs:9:17
   |
LL |       assert_sync(|| {
   |  _________________^
LL | |
LL | |         let a = Cell::new(2);
LL | |         yield;
LL | |     });
   | |_____^ generator is not `Sync`
   |
   = help: within `[generator@$DIR/not-send-sync.rs:9:17: 9:19]`, the trait `Sync` is not implemented for `Cell<i32>`
note: generator is not `Sync` as this value is used across a yield
  --> $DIR/not-send-sync.rs:12:9
   |
LL |         let a = Cell::new(2);
   |             - has type `Cell<i32>` which is not `Sync`
LL |         yield;
   |         ^^^^^ yield occurs here, with `a` maybe used later
LL |     });
   |     - `a` is later dropped here
note: required by a bound in `assert_sync`
  --> $DIR/not-send-sync.rs:6:23
   |
LL |     fn assert_sync<T: Sync>(_: T) {}
   |                       ^^^^ required by this bound in `assert_sync`

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0277`.