]> git.proxmox.com Git - rustc.git/blob - src/test/ui/async-await/issues/issue-65436-raw-ptr-not-send.stderr
New upstream version 1.49.0~beta.4+dfsg1
[rustc.git] / src / test / ui / async-await / issues / issue-65436-raw-ptr-not-send.stderr
1 error: future cannot be sent between threads safely
2 --> $DIR/issue-65436-raw-ptr-not-send.rs:12:5
3 |
4 LL | fn assert_send<T: Send>(_: T) {}
5 | ---- required by this bound in `assert_send`
6 ...
7 LL | assert_send(async {
8 | ^^^^^^^^^^^ future created by async block is not `Send`
9 |
10 = help: within `impl Future`, the trait `Send` is not implemented for `*const u8`
11 note: future is not `Send` as this value is used across an await
12 --> $DIR/issue-65436-raw-ptr-not-send.rs:14:9
13 |
14 LL | bar(Foo(std::ptr::null())).await;
15 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ first, await occurs here, with `std::ptr::null()` maybe used later...
16 note: `std::ptr::null()` is later dropped here
17 --> $DIR/issue-65436-raw-ptr-not-send.rs:14:41
18 |
19 LL | bar(Foo(std::ptr::null())).await;
20 | ---------------- ^
21 | |
22 | has type `*const u8` which is not `Send`
23 help: consider moving this into a `let` binding to create a shorter lived borrow
24 --> $DIR/issue-65436-raw-ptr-not-send.rs:14:13
25 |
26 LL | bar(Foo(std::ptr::null())).await;
27 | ^^^^^^^^^^^^^^^^^^^^^
28
29 error: aborting due to previous error
30