| error[E0277]: `dyn AsyncFn<Fut = Pin<Box<dyn Future<Output = ()> + Send>>>` cannot be shared between threads safely |
| --> $DIR/leaking-vars-in-cause-code-1.rs:32:17 |
| | |
| LL | assert_send(cursed_fut()); |
| | ----------- ^^^^^^^^^^^^ `dyn AsyncFn<Fut = Pin<Box<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 AsyncFn<Fut = Pin<Box<dyn Future<Output = ()> + Send>>>` |
| = note: required for `&dyn AsyncFn<Fut = Pin<Box<dyn Future<Output = ()> + Send>>>` to implement `Send` |
| note: required because it's used within this `async` fn body |
| --> $DIR/leaking-vars-in-cause-code-1.rs:19:53 |
| | |
| LL | async fn wrap_call<P: AsyncFn + ?Sized>(filter: &P) { |
| | _____________________________________________________^ |
| LL | | filter.call().await; |
| LL | | } |
| | |_^ |
| note: required because it's used within this `async` fn body |
| --> $DIR/leaking-vars-in-cause-code-1.rs:27:23 |
| | |
| LL | async fn cursed_fut() { |
| | _______________________^ |
| LL | | wrap_call(get_boxed_fn().as_ref()).await; |
| LL | | } |
| | |_^ |
| note: required by a bound in `assert_send` |
| --> $DIR/leaking-vars-in-cause-code-1.rs:36:19 |
| | |
| LL | fn assert_send<T: Send>(t: T) -> T { |
| | ^^^^ required by this bound in `assert_send` |
| |
| error: aborting due to 1 previous error |
| |
| For more information about this error, try `rustc --explain E0277`. |