rust/src/test/ui/generator/not-send-sync.stderr

34 lines
1.7 KiB
Plaintext
Raw Normal View History

2017-08-09 18:37:56 -05:00
error[E0277]: the trait bound `std::cell::Cell<i32>: std::marker::Sync` is not satisfied
--> $DIR/not-send-sync.rs:26:5
|
2018-02-22 18:42:32 -06:00
LL | assert_send(|| {
2017-08-09 18:37:56 -05:00
| ^^^^^^^^^^^ `std::cell::Cell<i32>` cannot be shared between threads safely
|
= help: the trait `std::marker::Sync` is not implemented for `std::cell::Cell<i32>`
= note: required because of the requirements on the impl of `std::marker::Send` for `&std::cell::Cell<i32>`
= note: required because it appears within the type `[generator@$DIR/not-send-sync.rs:26:17: 30:6 a:&std::cell::Cell<i32> _]`
note: required by `main::assert_send`
--> $DIR/not-send-sync.rs:17:5
|
2018-02-22 18:42:32 -06:00
LL | fn assert_send<T: Send>(_: T) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2017-08-09 18:37:56 -05:00
error[E0277]: the trait bound `std::cell::Cell<i32>: std::marker::Sync` is not satisfied in `[generator@$DIR/not-send-sync.rs:19:17: 23:6 {std::cell::Cell<i32>, ()}]`
2017-08-09 18:37:56 -05:00
--> $DIR/not-send-sync.rs:19:5
|
2018-02-22 18:42:32 -06:00
LL | assert_sync(|| {
2017-08-09 18:37:56 -05:00
| ^^^^^^^^^^^ `std::cell::Cell<i32>` cannot be shared between threads safely
|
= help: within `[generator@$DIR/not-send-sync.rs:19:17: 23:6 {std::cell::Cell<i32>, ()}]`, the trait `std::marker::Sync` is not implemented for `std::cell::Cell<i32>`
= note: required because it appears within the type `{std::cell::Cell<i32>, ()}`
= note: required because it appears within the type `[generator@$DIR/not-send-sync.rs:19:17: 23:6 {std::cell::Cell<i32>, ()}]`
note: required by `main::assert_sync`
--> $DIR/not-send-sync.rs:16:5
|
2018-02-22 18:42:32 -06:00
LL | fn assert_sync<T: Sync>(_: T) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2017-08-09 18:37:56 -05:00
error: aborting due to 2 previous errors
2018-02-19 14:40:25 -06:00
If you want more information on this error, try using "rustc --explain E0277"