]> git.proxmox.com Git - rustc.git/blob - src/test/ui/async-await/issues/issue-65436-raw-ptr-not-send.stderr
New upstream version 1.48.0~beta.8+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 | ^^^^^^^^----------------^^^^^^^^- `std::ptr::null()` is later dropped here
16 | | |
17 | | has type `*const u8` which is not `Send`
18 | await occurs here, with `std::ptr::null()` maybe used later
19 help: consider moving this into a `let` binding to create a shorter lived borrow
20 --> $DIR/issue-65436-raw-ptr-not-send.rs:14:13
21 |
22 LL | bar(Foo(std::ptr::null())).await;
23 | ^^^^^^^^^^^^^^^^^^^^^
24
25 error: aborting due to previous error
26