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
|
error[E0277]: `dyn Future<Output = ()> + Send` cannot be shared between threads safely
--> tests/ui/arg_not_sync.rs:13:20
|
13 | assert_is_sync(send_not_sync());
| -------------- ^^^^^^^^^^^^^^^ `dyn Future<Output = ()> + Send` cannot be shared between threads safely
| |
| required by a bound introduced by this call
|
= help: the trait `Sync` is not implemented for `dyn Future<Output = ()> + Send`, which is required by `Pin<Box<dyn Future<Output = ()> + Send>>: Sync`
= note: required for `Unique<dyn Future<Output = ()> + Send>` to implement `Sync`
note: required because it appears within the type `Box<dyn Future<Output = ()> + Send>`
--> $RUST/alloc/src/boxed.rs
|
| pub struct Box<
| ^^^
note: required because it appears within the type `Pin<Box<dyn Future<Output = ()> + Send>>`
--> $RUST/core/src/pin.rs
|
| pub struct Pin<Ptr> {
| ^^^
note: required by a bound in `assert_is_sync`
--> tests/ui/arg_not_sync.rs:3:27
|
3 | fn assert_is_sync(_: impl Sync) {}
| ^^^^ required by this bound in `assert_is_sync`
error[E0277]: `dyn Future<Output = ()>` cannot be shared between threads safely
--> tests/ui/arg_not_sync.rs:14:20
|
14 | assert_is_sync(not_send_not_sync());
| -------------- ^^^^^^^^^^^^^^^^^^^ `dyn Future<Output = ()>` cannot be shared between threads safely
| |
| required by a bound introduced by this call
|
= help: the trait `Sync` is not implemented for `dyn Future<Output = ()>`, which is required by `Pin<Box<dyn Future<Output = ()>>>: Sync`
= note: required for `Unique<dyn Future<Output = ()>>` to implement `Sync`
note: required because it appears within the type `Box<dyn Future<Output = ()>>`
--> $RUST/alloc/src/boxed.rs
|
| pub struct Box<
| ^^^
note: required because it appears within the type `Pin<Box<dyn Future<Output = ()>>>`
--> $RUST/core/src/pin.rs
|
| pub struct Pin<Ptr> {
| ^^^
note: required by a bound in `assert_is_sync`
--> tests/ui/arg_not_sync.rs:3:27
|
3 | fn assert_is_sync(_: impl Sync) {}
| ^^^^ required by this bound in `assert_is_sync`
|