]> git.lizzy.rs Git - rust.git/blob - tests/ui/async-await/issues/issue-65436-raw-ptr-not-send.no_drop_tracking.stderr
Rollup merge of #107061 - compiler-errors:new-solver-new-candidates-3, r=lcnr
[rust.git] / tests / ui / async-await / issues / issue-65436-raw-ptr-not-send.no_drop_tracking.stderr
1 error: future cannot be sent between threads safely
2   --> $DIR/issue-65436-raw-ptr-not-send.rs:16:17
3    |
4 LL |       assert_send(async {
5    |  _________________^
6 LL | |
7 LL | |         bar(Foo(std::ptr::null())).await;
8 LL | |     })
9    | |_____^ future created by async block is not `Send`
10    |
11    = help: within `[async block@$DIR/issue-65436-raw-ptr-not-send.rs:16:17: 19:6]`, the trait `Send` is not implemented for `*const u8`
12 note: future is not `Send` as this value is used across an await
13   --> $DIR/issue-65436-raw-ptr-not-send.rs:18:35
14    |
15 LL |         bar(Foo(std::ptr::null())).await;
16    |                 ----------------  ^^^^^^- `std::ptr::null()` is later dropped here
17    |                 |                 |
18    |                 |                 await occurs here, with `std::ptr::null()` maybe used later
19    |                 has type `*const u8` which is not `Send`
20 help: consider moving this into a `let` binding to create a shorter lived borrow
21   --> $DIR/issue-65436-raw-ptr-not-send.rs:18: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:13: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