rust/tests/ui/async-await/issues/issue-65436-raw-ptr-not-send.no_drop_tracking.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

33 lines
1.3 KiB
Plaintext
Raw Normal View History

error: future cannot be sent between threads safely
2023-01-25 21:51:26 -06:00
--> $DIR/issue-65436-raw-ptr-not-send.rs:17:17
|
2022-08-16 01:27:22 -05:00
LL | assert_send(async {
| _________________^
LL | |
LL | | bar(Foo(std::ptr::null())).await;
LL | | })
| |_____^ future created by async block is not `Send`
|
2023-01-25 21:51:26 -06:00
= help: within `[async block@$DIR/issue-65436-raw-ptr-not-send.rs:17:17: 20:6]`, the trait `Send` is not implemented for `*const u8`
note: future is not `Send` as this value is used across an await
2023-04-25 13:59:16 -05:00
--> $DIR/issue-65436-raw-ptr-not-send.rs:19:36
|
LL | bar(Foo(std::ptr::null())).await;
2023-04-25 13:59:16 -05:00
| ---------------- ^^^^^- `std::ptr::null()` is later dropped here
| | |
| | await occurs here, with `std::ptr::null()` maybe used later
| has type `*const u8` which is not `Send`
help: consider moving this into a `let` binding to create a shorter lived borrow
--> $DIR/issue-65436-raw-ptr-not-send.rs:19:13
|
LL | bar(Foo(std::ptr::null())).await;
| ^^^^^^^^^^^^^^^^^^^^^
note: required by a bound in `assert_send`
2023-01-25 21:51:26 -06:00
--> $DIR/issue-65436-raw-ptr-not-send.rs:14:19
|
LL | fn assert_send<T: Send>(_: T) {}
| ^^^^ required by this bound in `assert_send`
error: aborting due to previous error