2020-01-18 22:59:59 -06:00
|
|
|
error: future cannot be sent between threads safely
|
2022-09-13 16:39:36 -05:00
|
|
|
--> $DIR/issue-65436-raw-ptr-not-send.rs:16:17
|
2020-01-18 22:59:59 -06:00
|
|
|
|
|
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`
|
2020-01-18 22:59:59 -06:00
|
|
|
|
|
2022-11-25 02:53:58 -06:00
|
|
|
= 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`
|
2020-01-18 22:59:59 -06:00
|
|
|
note: future is not `Send` as this value is used across an await
|
2022-09-13 16:39:36 -05:00
|
|
|
--> $DIR/issue-65436-raw-ptr-not-send.rs:18:35
|
2020-01-18 22:59:59 -06:00
|
|
|
|
|
|
|
|
LL | bar(Foo(std::ptr::null())).await;
|
2021-12-02 17:41:45 -06:00
|
|
|
| ---------------- ^^^^^^ await occurs here, with `std::ptr::null()` maybe used later
|
|
|
|
| |
|
2020-11-02 01:54:53 -06:00
|
|
|
| has type `*const u8` which is not `Send`
|
2021-12-02 17:41:45 -06:00
|
|
|
note: `std::ptr::null()` is later dropped here
|
2022-09-13 16:39:36 -05:00
|
|
|
--> $DIR/issue-65436-raw-ptr-not-send.rs:18:41
|
2021-12-02 17:41:45 -06:00
|
|
|
|
|
|
|
|
LL | bar(Foo(std::ptr::null())).await;
|
|
|
|
| ^
|
2020-01-18 22:59:59 -06:00
|
|
|
help: consider moving this into a `let` binding to create a shorter lived borrow
|
2022-09-13 16:39:36 -05:00
|
|
|
--> $DIR/issue-65436-raw-ptr-not-send.rs:18:13
|
2020-01-18 22:59:59 -06:00
|
|
|
|
|
|
|
|
LL | bar(Foo(std::ptr::null())).await;
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
2021-07-31 11:26:55 -05:00
|
|
|
note: required by a bound in `assert_send`
|
2022-09-13 16:39:36 -05:00
|
|
|
--> $DIR/issue-65436-raw-ptr-not-send.rs:13:19
|
2021-07-31 11:26:55 -05:00
|
|
|
|
|
|
|
|
LL | fn assert_send<T: Send>(_: T) {}
|
|
|
|
| ^^^^ required by this bound in `assert_send`
|
2020-01-18 22:59:59 -06:00
|
|
|
|
|
|
|
error: aborting due to previous error
|
|
|
|
|