]> git.proxmox.com Git - rustc.git/blob - tests/ui/async-await/issue-67252-unnamed-future.drop_tracking.stderr
New upstream version 1.69.0+dfsg1
[rustc.git] / tests / ui / async-await / issue-67252-unnamed-future.drop_tracking.stderr
1 error: future cannot be sent between threads safely
2 --> $DIR/issue-67252-unnamed-future.rs:21: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 | | drop(a);
9 LL | | });
10 | |_____^ future created by async block is not `Send`
11 |
12 = help: within `[async block@$DIR/issue-67252-unnamed-future.rs:21:11: 25:6]`, the trait `Send` is not implemented for `*mut ()`
13 note: future is not `Send` as this value is used across an await
14 --> $DIR/issue-67252-unnamed-future.rs:23:16
15 |
16 LL | let a = std::ptr::null_mut::<()>(); // `*mut ()` is not `Send`
17 | - has type `*mut ()` which is not `Send`
18 LL | AFuture.await;
19 | ^^^^^^ await occurs here, with `a` maybe used later
20 LL | drop(a);
21 LL | });
22 | - `a` is later dropped here
23 note: required by a bound in `spawn`
24 --> $DIR/issue-67252-unnamed-future.rs:9:13
25 |
26 LL | fn spawn<T: Send>(_: T) {}
27 | ^^^^ required by this bound in `spawn`
28
29 error: aborting due to previous error
30