1
Fork 0
rust/src/test/ui/async-await/async-fn-nonsend.stderr

50 lines
1.9 KiB
Text
Raw Normal View History

error: future cannot be sent between threads safely
2021-12-16 13:34:39 -08:00
--> $DIR/async-fn-nonsend.rs:57:17
2019-06-24 17:48:21 -07:00
|
LL | assert_send(non_send_temporary_in_match());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `non_send_temporary_in_match` is not `Send`
2019-06-24 17:48:21 -07:00
|
2021-11-16 16:16:23 -08:00
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`
note: future is not `Send` as this value is used across an await
--> $DIR/async-fn-nonsend.rs:33:25
|
LL | match Some(non_send()) {
2021-11-22 14:53:02 -08:00
| ---------------- has type `Option<impl Debug>` which is not `Send`
LL | Some(_) => fut().await,
2021-11-22 14:53:02 -08:00
| ^^^^^^ await occurs here, with `Some(non_send())` maybe used later
...
LL | }
2021-11-22 14:53:02 -08:00
| - `Some(non_send())` is later dropped here
note: required by a bound in `assert_send`
2021-12-16 13:34:39 -08:00
--> $DIR/async-fn-nonsend.rs:53:24
|
LL | fn assert_send(_: impl Send) {}
| ^^^^ required by this bound in `assert_send`
2019-06-24 17:48:21 -07:00
error: future cannot be sent between threads safely
2021-12-16 13:34:39 -08:00
--> $DIR/async-fn-nonsend.rs:59:17
2019-06-24 17:48:21 -07:00
|
LL | assert_send(non_sync_with_method_call());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `non_sync_with_method_call` is not `Send`
2019-06-24 17:48:21 -07:00
|
= help: the trait `Send` is not implemented for `dyn std::fmt::Write`
note: future is not `Send` as this value is used across an await
--> $DIR/async-fn-nonsend.rs:42:14
|
LL | let f: &mut std::fmt::Formatter = panic!();
| - has type `&mut Formatter<'_>` which is not `Send`
LL | if non_sync().fmt(f).unwrap() == () {
LL | fut().await;
| ^^^^^^ await occurs here, with `f` maybe used later
LL | }
LL | }
| - `f` is later dropped here
note: required by a bound in `assert_send`
2021-12-16 13:34:39 -08:00
--> $DIR/async-fn-nonsend.rs:53:24
|
LL | fn assert_send(_: impl Send) {}
| ^^^^ required by this bound in `assert_send`
2019-06-24 17:48:21 -07:00
2021-11-22 14:53:02 -08:00
error: aborting due to 2 previous errors
2019-06-24 17:48:21 -07:00