]>
Commit | Line | Data |
---|---|---|
0531ce1d | 1 | error[E0277]: `std::cell::Cell<i32>` cannot be shared between threads safely |
0731742a | 2 | --> $DIR/not-send-sync.rs:16:5 |
ea8adc8c | 3 | | |
e1599b0c | 4 | LL | fn assert_send<T: Send>(_: T) {} |
ba9703b0 | 5 | | ---- required by this bound in `main::assert_send` |
e1599b0c | 6 | ... |
0531ce1d | 7 | LL | assert_send(|| { |
ea8adc8c XL |
8 | | ^^^^^^^^^^^ `std::cell::Cell<i32>` cannot be shared between threads safely |
9 | | | |
10 | = help: the trait `std::marker::Sync` is not implemented for `std::cell::Cell<i32>` | |
11 | = note: required because of the requirements on the impl of `std::marker::Send` for `&std::cell::Cell<i32>` | |
0731742a | 12 | = note: required because it appears within the type `[generator@$DIR/not-send-sync.rs:16:17: 20:6 a:&std::cell::Cell<i32> _]` |
ea8adc8c | 13 | |
ba9703b0 | 14 | error: generator cannot be shared between threads safely |
0731742a | 15 | --> $DIR/not-send-sync.rs:9:5 |
ea8adc8c | 16 | | |
e1599b0c | 17 | LL | fn assert_sync<T: Sync>(_: T) {} |
ba9703b0 | 18 | | ---- required by this bound in `main::assert_sync` |
e1599b0c | 19 | ... |
0531ce1d | 20 | LL | assert_sync(|| { |
ba9703b0 | 21 | | ^^^^^^^^^^^ generator is not `Sync` |
ea8adc8c | 22 | | |
74b04a01 | 23 | = help: within `[generator@$DIR/not-send-sync.rs:9:17: 13:6 {std::cell::Cell<i32>, ()}]`, the trait `std::marker::Sync` is not implemented for `std::cell::Cell<i32>` |
ba9703b0 | 24 | note: generator is not `Sync` as this value is used across a yield |
60c5eb7d XL |
25 | --> $DIR/not-send-sync.rs:12:9 |
26 | | | |
27 | LL | let a = Cell::new(2); | |
ba9703b0 | 28 | | - has type `std::cell::Cell<i32>` which is not `Sync` |
60c5eb7d XL |
29 | LL | yield; |
30 | | ^^^^^ yield occurs here, with `a` maybe used later | |
31 | LL | }); | |
32 | | - `a` is later dropped here | |
ea8adc8c XL |
33 | |
34 | error: aborting due to 2 previous errors | |
35 | ||
0531ce1d | 36 | For more information about this error, try `rustc --explain E0277`. |