]> git.lizzy.rs Git - rust.git/blob - src/test/ui/async-await/issues/issue-65436-raw-ptr-not-send.stderr
Merge commit '7b73b60faca71d01d900e49831fcb84553e93019' into sync-rustfmt
[rust.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 |     assert_send(async {
5    |     ^^^^^^^^^^^ future created by async block is not `Send`
6    |
7    = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `*const u8`
8 note: future is not `Send` as this value is used across an await
9   --> $DIR/issue-65436-raw-ptr-not-send.rs:14:35
10    |
11 LL |         bar(Foo(std::ptr::null())).await;
12    |                 ----------------  ^^^^^^ await occurs here, with `std::ptr::null()` maybe used later
13    |                 |
14    |                 has type `*const u8` which is not `Send`
15 note: `std::ptr::null()` is later dropped here
16   --> $DIR/issue-65436-raw-ptr-not-send.rs:14:41
17    |
18 LL |         bar(Foo(std::ptr::null())).await;
19    |                                         ^
20 help: consider moving this into a `let` binding to create a shorter lived borrow
21   --> $DIR/issue-65436-raw-ptr-not-send.rs:14:13
22    |
23 LL |         bar(Foo(std::ptr::null())).await;
24    |             ^^^^^^^^^^^^^^^^^^^^^
25 note: required by a bound in `assert_send`
26   --> $DIR/issue-65436-raw-ptr-not-send.rs:9:19
27    |
28 LL | fn assert_send<T: Send>(_: T) {}
29    |                   ^^^^ required by this bound in `assert_send`
30
31 error: aborting due to previous error
32