]> git.lizzy.rs Git - rust.git/blob - tests/ui/async-await/async-fn-nonsend.stderr
Rollup merge of #106946 - dtolnay:hashlinecolumn, r=m-ou-se
[rust.git] / tests / ui / async-await / async-fn-nonsend.stderr
1 error: future cannot be sent between threads safely
2   --> $DIR/async-fn-nonsend.rs:68:17
3    |
4 LL |     assert_send(non_send_temporary_in_match());
5    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `non_send_temporary_in_match` is not `Send`
6    |
7    = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`
8 note: future is not `Send` as this value is used across an await
9   --> $DIR/async-fn-nonsend.rs:33:25
10    |
11 LL |     match Some(non_send()) {
12    |           ---------------- has type `Option<impl Debug>` which is not `Send`
13 LL |         Some(_) => fut().await,
14    |                         ^^^^^^ await occurs here, with `Some(non_send())` maybe used later
15 ...
16 LL | }
17    | - `Some(non_send())` is later dropped here
18 note: required by a bound in `assert_send`
19   --> $DIR/async-fn-nonsend.rs:64:24
20    |
21 LL | fn assert_send(_: impl Send) {}
22    |                        ^^^^ required by this bound in `assert_send`
23
24 error: future cannot be sent between threads safely
25   --> $DIR/async-fn-nonsend.rs:70:17
26    |
27 LL |     assert_send(non_sync_with_method_call());
28    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `non_sync_with_method_call` is not `Send`
29    |
30    = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `dyn std::fmt::Write`
31 note: future is not `Send` as this value is used across an await
32   --> $DIR/async-fn-nonsend.rs:46:14
33    |
34 LL |     let f: &mut std::fmt::Formatter = &mut get_formatter();
35    |                                            --------------- has type `Formatter<'_>` which is not `Send`
36 ...
37 LL |         fut().await;
38    |              ^^^^^^ await occurs here, with `get_formatter()` maybe used later
39 LL |     }
40 LL | }
41    | - `get_formatter()` is later dropped here
42 note: required by a bound in `assert_send`
43   --> $DIR/async-fn-nonsend.rs:64:24
44    |
45 LL | fn assert_send(_: impl Send) {}
46    |                        ^^^^ required by this bound in `assert_send`
47
48 error: aborting due to 2 previous errors
49