]> git.lizzy.rs Git - rust.git/blob - src/test/ui/async-await/issue-67252-unnamed-future.stderr
Rollup merge of #71627 - ldm0:autoderefarg, r=Dylan-DPC
[rust.git] / src / test / ui / async-await / issue-67252-unnamed-future.stderr
1 error: future cannot be sent between threads safely
2   --> $DIR/issue-67252-unnamed-future.rs:18:5
3    |
4 LL | fn spawn<T: Send>(_: T) {}
5    |             ---- required by this bound in `spawn`
6 ...
7 LL |     spawn(async {
8    |     ^^^^^ future created by async block is not `Send`
9    |
10    = help: within `impl std::future::Future`, the trait `std::marker::Send` is not implemented for `*mut ()`
11 note: future is not `Send` as this value is used across an await
12   --> $DIR/issue-67252-unnamed-future.rs:20:9
13    |
14 LL |         let _a = std::ptr::null_mut::<()>(); // `*mut ()` is not `Send`
15    |             -- has type `*mut ()` which is not `Send`
16 LL |         AFuture.await;
17    |         ^^^^^^^^^^^^^ await occurs here, with `_a` maybe used later
18 LL |     });
19    |     - `_a` is later dropped here
20
21 error: aborting due to previous error
22