]> git.lizzy.rs Git - rust.git/blob - src/test/ui/async-await/async-fn-nonsend.stderr
Rollup merge of #71627 - ldm0:autoderefarg, r=Dylan-DPC
[rust.git] / src / test / ui / async-await / async-fn-nonsend.stderr
1 error: future cannot be sent between threads safely
2   --> $DIR/async-fn-nonsend.rs:49:5
3    |
4 LL | fn assert_send(_: impl Send) {}
5    |                        ---- required by this bound in `assert_send`
6 ...
7 LL |     assert_send(local_dropped_before_await());
8    |     ^^^^^^^^^^^ future returned by `local_dropped_before_await` is not `Send`
9    |
10    = help: within `impl std::future::Future`, the trait `std::marker::Send` is not implemented for `std::rc::Rc<()>`
11 note: future is not `Send` as this value is used across an await
12   --> $DIR/async-fn-nonsend.rs:24:5
13    |
14 LL |     let x = non_send();
15    |         - has type `impl std::fmt::Debug` which is not `Send`
16 LL |     drop(x);
17 LL |     fut().await;
18    |     ^^^^^^^^^^^ await occurs here, with `x` maybe used later
19 LL | }
20    | - `x` is later dropped here
21
22 error: future cannot be sent between threads safely
23   --> $DIR/async-fn-nonsend.rs:51:5
24    |
25 LL | fn assert_send(_: impl Send) {}
26    |                        ---- required by this bound in `assert_send`
27 ...
28 LL |     assert_send(non_send_temporary_in_match());
29    |     ^^^^^^^^^^^ future returned by `non_send_temporary_in_match` is not `Send`
30    |
31    = help: within `impl std::future::Future`, the trait `std::marker::Send` is not implemented for `std::rc::Rc<()>`
32 note: future is not `Send` as this value is used across an await
33   --> $DIR/async-fn-nonsend.rs:33:20
34    |
35 LL |     match Some(non_send()) {
36    |                ---------- has type `impl std::fmt::Debug` which is not `Send`
37 LL |         Some(_) => fut().await,
38    |                    ^^^^^^^^^^^ await occurs here, with `non_send()` maybe used later
39 ...
40 LL | }
41    | - `non_send()` is later dropped here
42
43 error: future cannot be sent between threads safely
44   --> $DIR/async-fn-nonsend.rs:53:5
45    |
46 LL | fn assert_send(_: impl Send) {}
47    |                        ---- required by this bound in `assert_send`
48 ...
49 LL |     assert_send(non_sync_with_method_call());
50    |     ^^^^^^^^^^^ future returned by `non_sync_with_method_call` is not `Send`
51    |
52    = help: the trait `std::marker::Send` is not implemented for `dyn std::fmt::Write`
53 note: future is not `Send` as this value is used across an await
54   --> $DIR/async-fn-nonsend.rs:42:9
55    |
56 LL |     let f: &mut std::fmt::Formatter = panic!();
57    |         - has type `&mut std::fmt::Formatter<'_>` which is not `Send`
58 LL |     if non_sync().fmt(f).unwrap() == () {
59 LL |         fut().await;
60    |         ^^^^^^^^^^^ await occurs here, with `f` maybe used later
61 LL |     }
62 LL | }
63    | - `f` is later dropped here
64
65 error: aborting due to 3 previous errors
66