2019-10-06 23:14:34 +01:00
|
|
|
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());
|
2021-10-22 13:49:12 -07:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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<()>`
|
2019-10-06 23:14:34 +01:00
|
|
|
note: future is not `Send` as this value is used across an await
|
2021-11-16 00:57:53 +00:00
|
|
|
--> $DIR/async-fn-nonsend.rs:33:25
|
2019-10-06 23:14:34 +01:00
|
|
|
|
|
|
|
|
LL | match Some(non_send()) {
|
2021-11-22 14:53:02 -08:00
|
|
|
| ---------------- has type `Option<impl Debug>` which is not `Send`
|
2019-10-06 23:14:34 +01:00
|
|
|
LL | Some(_) => fut().await,
|
2021-11-22 14:53:02 -08:00
|
|
|
| ^^^^^^ await occurs here, with `Some(non_send())` maybe used later
|
2019-10-06 23:14:34 +01:00
|
|
|
...
|
|
|
|
LL | }
|
2021-11-22 14:53:02 -08:00
|
|
|
| - `Some(non_send())` is later dropped here
|
2021-07-31 09:26:55 -07:00
|
|
|
note: required by a bound in `assert_send`
|
2021-12-16 13:34:39 -08:00
|
|
|
--> $DIR/async-fn-nonsend.rs:53:24
|
2021-07-31 09:26:55 -07:00
|
|
|
|
|
|
|
|
LL | fn assert_send(_: impl Send) {}
|
|
|
|
| ^^^^ required by this bound in `assert_send`
|
2019-06-24 17:48:21 -07:00
|
|
|
|
2019-10-06 23:14:34 +01: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());
|
2021-10-22 13:49:12 -07:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `non_sync_with_method_call` is not `Send`
|
2019-06-24 17:48:21 -07:00
|
|
|
|
|
2020-09-02 10:40:56 +03:00
|
|
|
= help: the trait `Send` is not implemented for `dyn std::fmt::Write`
|
2019-10-06 23:14:34 +01:00
|
|
|
note: future is not `Send` as this value is used across an await
|
2021-11-16 00:57:53 +00:00
|
|
|
--> $DIR/async-fn-nonsend.rs:42:14
|
2019-10-06 23:14:34 +01:00
|
|
|
|
|
|
|
|
LL | let f: &mut std::fmt::Formatter = panic!();
|
2020-09-02 10:40:56 +03:00
|
|
|
| - has type `&mut Formatter<'_>` which is not `Send`
|
2019-10-06 23:14:34 +01:00
|
|
|
LL | if non_sync().fmt(f).unwrap() == () {
|
|
|
|
LL | fut().await;
|
2021-11-16 00:57:53 +00:00
|
|
|
| ^^^^^^ await occurs here, with `f` maybe used later
|
2019-10-06 23:14:34 +01:00
|
|
|
LL | }
|
|
|
|
LL | }
|
|
|
|
| - `f` is later dropped here
|
2021-07-31 09:26:55 -07:00
|
|
|
note: required by a bound in `assert_send`
|
2021-12-16 13:34:39 -08:00
|
|
|
--> $DIR/async-fn-nonsend.rs:53:24
|
2021-07-31 09:26:55 -07:00
|
|
|
|
|
|
|
|
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
|
|
|
|