2020-09-02 02:40:56 -05:00
|
|
|
error[E0277]: `Cell<i32>` cannot be shared between threads safely
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/not-send-sync.rs:16:5
|
2017-08-09 18:37:56 -05:00
|
|
|
|
|
2018-02-22 18:42:32 -06:00
|
|
|
LL | assert_send(|| {
|
2020-09-02 02:40:56 -05:00
|
|
|
| ^^^^^^^^^^^ `Cell<i32>` cannot be shared between threads safely
|
2017-08-09 18:37:56 -05:00
|
|
|
|
|
2020-09-02 02:40:56 -05:00
|
|
|
= help: the trait `Sync` is not implemented for `Cell<i32>`
|
|
|
|
= note: required because of the requirements on the impl of `Send` for `&Cell<i32>`
|
2022-06-19 13:59:36 -05:00
|
|
|
note: required because it's used within this generator
|
|
|
|
--> $DIR/not-send-sync.rs:16:17
|
|
|
|
|
|
2022-06-27 00:45:35 -05:00
|
|
|
LL | assert_send(|| {
|
|
|
|
| ^^
|
2021-07-31 11:26:55 -05:00
|
|
|
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`
|
2017-08-09 18:37:56 -05:00
|
|
|
|
2020-03-24 23:13:05 -05:00
|
|
|
error: generator cannot be shared between threads safely
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/not-send-sync.rs:9:5
|
2017-08-09 18:37:56 -05:00
|
|
|
|
|
2018-02-22 18:42:32 -06:00
|
|
|
LL | assert_sync(|| {
|
2020-03-24 20:51:16 -05:00
|
|
|
| ^^^^^^^^^^^ generator is not `Sync`
|
2017-08-09 18:37:56 -05:00
|
|
|
|
|
2022-06-27 00:45:35 -05:00
|
|
|
= help: within `[generator@$DIR/not-send-sync.rs:9:17: 9:19]`, the trait `Sync` is not implemented for `Cell<i32>`
|
2020-04-08 13:54:31 -05:00
|
|
|
note: generator is not `Sync` as this value is used across a yield
|
2019-10-06 17:14:34 -05:00
|
|
|
--> $DIR/not-send-sync.rs:12:9
|
|
|
|
|
|
|
|
|
LL | let a = Cell::new(2);
|
2020-09-02 02:40:56 -05:00
|
|
|
| - has type `Cell<i32>` which is not `Sync`
|
2019-10-06 17:14:34 -05:00
|
|
|
LL | yield;
|
|
|
|
| ^^^^^ yield occurs here, with `a` maybe used later
|
|
|
|
LL | });
|
|
|
|
| - `a` is later dropped here
|
2021-07-31 11:26:55 -05:00
|
|
|
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`
|
2017-08-09 18:37:56 -05:00
|
|
|
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
|
2018-03-03 08:59:40 -06:00
|
|
|
For more information about this error, try `rustc --explain E0277`.
|