2019-10-06 22:14:34 +00:00
|
|
|
error: future cannot be sent between threads safely
|
2021-10-22 20:49:12 +00:00
|
|
|
--> $DIR/async-fn-nonsend.rs:49:17
|
2019-06-25 00:48:21 +00:00
|
|
|
|
|
|
|
|
LL | assert_send(local_dropped_before_await());
|
2021-10-22 20:49:12 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `local_dropped_before_await` is not `Send`
|
2019-06-25 00:48:21 +00:00
|
|
|
|
|
2021-11-17 00:16:23 +00:00
|
|
|
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`
|
2019-10-06 22:14:34 +00:00
|
|
|
note: future is not `Send` as this value is used across an await
|
2020-02-02 06:05:53 +00:00
|
|
|
--> $DIR/async-fn-nonsend.rs:24:5
|
2019-10-06 22:14:34 +00:00
|
|
|
|
|
|
|
|
LL | let x = non_send();
|
2020-09-02 07:40:56 +00:00
|
|
|
| - has type `impl Debug` which is not `Send`
|
2019-10-06 22:14:34 +00:00
|
|
|
LL | drop(x);
|
|
|
|
LL | fut().await;
|
|
|
|
| ^^^^^^^^^^^ await occurs here, with `x` maybe used later
|
|
|
|
LL | }
|
|
|
|
| - `x` is later dropped here
|
2021-07-31 16:26:55 +00:00
|
|
|
note: required by a bound in `assert_send`
|
|
|
|
--> $DIR/async-fn-nonsend.rs:46:24
|
|
|
|
|
|
|
|
|
LL | fn assert_send(_: impl Send) {}
|
|
|
|
| ^^^^ required by this bound in `assert_send`
|
2019-06-25 00:48:21 +00:00
|
|
|
|
2019-10-06 22:14:34 +00:00
|
|
|
error: future cannot be sent between threads safely
|
2021-10-22 20:49:12 +00:00
|
|
|
--> $DIR/async-fn-nonsend.rs:51:17
|
2019-06-25 00:48:21 +00:00
|
|
|
|
|
|
|
|
LL | assert_send(non_send_temporary_in_match());
|
2021-10-22 20:49:12 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `non_send_temporary_in_match` is not `Send`
|
2019-06-25 00:48:21 +00:00
|
|
|
|
|
2021-11-17 00:16:23 +00:00
|
|
|
= help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`
|
2019-10-06 22:14:34 +00:00
|
|
|
note: future is not `Send` as this value is used across an await
|
2020-02-02 06:05:53 +00:00
|
|
|
--> $DIR/async-fn-nonsend.rs:33:20
|
2019-10-06 22:14:34 +00:00
|
|
|
|
|
|
|
|
LL | match Some(non_send()) {
|
2020-09-02 07:40:56 +00:00
|
|
|
| ---------- has type `impl Debug` which is not `Send`
|
2019-10-06 22:14:34 +00:00
|
|
|
LL | Some(_) => fut().await,
|
|
|
|
| ^^^^^^^^^^^ await occurs here, with `non_send()` maybe used later
|
|
|
|
...
|
|
|
|
LL | }
|
|
|
|
| - `non_send()` is later dropped here
|
2021-07-31 16:26:55 +00:00
|
|
|
note: required by a bound in `assert_send`
|
|
|
|
--> $DIR/async-fn-nonsend.rs:46:24
|
|
|
|
|
|
|
|
|
LL | fn assert_send(_: impl Send) {}
|
|
|
|
| ^^^^ required by this bound in `assert_send`
|
2019-06-25 00:48:21 +00:00
|
|
|
|
2019-10-06 22:14:34 +00:00
|
|
|
error: future cannot be sent between threads safely
|
2021-10-22 20:49:12 +00:00
|
|
|
--> $DIR/async-fn-nonsend.rs:53:17
|
2019-06-25 00:48:21 +00:00
|
|
|
|
|
|
|
|
LL | assert_send(non_sync_with_method_call());
|
2021-10-22 20:49:12 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `non_sync_with_method_call` is not `Send`
|
2019-06-25 00:48:21 +00:00
|
|
|
|
|
2020-09-02 07:40:56 +00:00
|
|
|
= help: the trait `Send` is not implemented for `dyn std::fmt::Write`
|
2019-10-06 22:14:34 +00:00
|
|
|
note: future is not `Send` as this value is used across an await
|
2020-02-02 06:05:53 +00:00
|
|
|
--> $DIR/async-fn-nonsend.rs:42:9
|
2019-10-06 22:14:34 +00:00
|
|
|
|
|
|
|
|
LL | let f: &mut std::fmt::Formatter = panic!();
|
2020-09-02 07:40:56 +00:00
|
|
|
| - has type `&mut Formatter<'_>` which is not `Send`
|
2019-10-06 22:14:34 +00:00
|
|
|
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
|
2021-07-31 16:26:55 +00:00
|
|
|
note: required by a bound in `assert_send`
|
|
|
|
--> $DIR/async-fn-nonsend.rs:46:24
|
|
|
|
|
|
|
|
|
LL | fn assert_send(_: impl Send) {}
|
|
|
|
| ^^^^ required by this bound in `assert_send`
|
2019-06-25 00:48:21 +00:00
|
|
|
|
2020-01-20 17:17:12 +00:00
|
|
|
error: aborting due to 3 previous errors
|
2019-06-25 00:48:21 +00:00
|
|
|
|