2020-01-18 22:59:59 -06:00
|
|
|
error: future cannot be sent between threads safely
|
|
|
|
--> $DIR/issue-65436-raw-ptr-not-send.rs:12:5
|
|
|
|
|
|
|
|
|
LL | fn assert_send<T: Send>(_: T) {}
|
2020-04-06 00:15:06 -05:00
|
|
|
| ---- required by this bound in `assert_send`
|
2020-01-18 22:59:59 -06:00
|
|
|
...
|
|
|
|
LL | assert_send(async {
|
2020-03-24 20:51:16 -05:00
|
|
|
| ^^^^^^^^^^^ future created by async block is not `Send`
|
2020-01-18 22:59:59 -06:00
|
|
|
|
|
2020-09-02 02:40:56 -05:00
|
|
|
= help: within `impl Future`, 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
|
|
|
|
--> $DIR/issue-65436-raw-ptr-not-send.rs:14:9
|
|
|
|
|
|
|
|
|
LL | bar(Foo(std::ptr::null())).await;
|
2020-10-10 14:48:17 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ first, await occurs here, with `std::ptr::null()` maybe used later...
|
|
|
|
note: `std::ptr::null()` is later dropped here
|
2020-10-10 13:05:57 -05:00
|
|
|
--> $DIR/issue-65436-raw-ptr-not-send.rs:14:41
|
|
|
|
|
|
|
|
|
LL | bar(Foo(std::ptr::null())).await;
|
2020-11-02 01:54:53 -06:00
|
|
|
| ---------------- ^
|
|
|
|
| |
|
|
|
|
| has type `*const u8` which is not `Send`
|
2020-01-18 22:59:59 -06:00
|
|
|
help: consider moving this into a `let` binding to create a shorter lived borrow
|
|
|
|
--> $DIR/issue-65436-raw-ptr-not-send.rs:14:13
|
|
|
|
|
|
|
|
|
LL | bar(Foo(std::ptr::null())).await;
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: aborting due to previous error
|
|
|
|
|