Files
rust/src/test/ui/async-await/issue-67252-unnamed-future.stderr

23 lines
815 B
Plaintext
Raw Normal View History

2019-12-13 15:27:55 -08:00
error: future cannot be sent between threads safely
--> $DIR/issue-67252-unnamed-future.rs:18:5
|
LL | fn spawn<T: Send>(_: T) {}
2020-04-05 22:15:06 -07:00
| ---- required by this bound in `spawn`
2019-12-13 15:27:55 -08:00
...
LL | spawn(async {
2020-03-24 18:51:16 -07:00
| ^^^^^ future created by async block is not `Send`
2019-12-13 15:27:55 -08:00
|
= help: within `impl std::future::Future`, the trait `std::marker::Send` is not implemented for `*mut ()`
note: future is not `Send` as this value is used across an await
--> $DIR/issue-67252-unnamed-future.rs:20:9
|
LL | let _a = std::ptr::null_mut::<()>(); // `*mut ()` is not `Send`
| -- has type `*mut ()`
LL | AFuture.await;
| ^^^^^^^^^^^^^ await occurs here, with `_a` maybe used later
LL | });
| - `_a` is later dropped here
error: aborting due to previous error