]> git.lizzy.rs Git - rust.git/blob - tests/ui/async-await/issue-67252-unnamed-future.stderr
Rollup merge of #107027 - GuillaumeGomez:rm-extra-removal, r=tmiasko
[rust.git] / tests / 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:11
3    |
4 LL |       spawn(async {
5    |  ___________^
6 LL | |         let _a = std::ptr::null_mut::<()>(); // `*mut ()` is not `Send`
7 LL | |         AFuture.await;
8 LL | |     });
9    | |_____^ future created by async block is not `Send`
10    |
11    = help: within `[async block@$DIR/issue-67252-unnamed-future.rs:18:11: 21:6]`, the trait `Send` is not implemented for `*mut ()`
12 note: future is not `Send` as this value is used across an await
13   --> $DIR/issue-67252-unnamed-future.rs:20:16
14    |
15 LL |         let _a = std::ptr::null_mut::<()>(); // `*mut ()` is not `Send`
16    |             -- has type `*mut ()` which is not `Send`
17 LL |         AFuture.await;
18    |                ^^^^^^ await occurs here, with `_a` maybe used later
19 LL |     });
20    |     - `_a` is later dropped here
21 note: required by a bound in `spawn`
22   --> $DIR/issue-67252-unnamed-future.rs:6:13
23    |
24 LL | fn spawn<T: Send>(_: T) {}
25    |             ^^^^ required by this bound in `spawn`
26
27 error: aborting due to previous error
28