]> git.proxmox.com Git - rustc.git/blob - src/test/ui/async-await/async-fn-nonsend.stderr
New upstream version 1.58.1+dfsg1
[rustc.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:17
3 |
4 LL | assert_send(local_dropped_before_await());
5 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `local_dropped_before_await` 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:24:5
10 |
11 LL | let x = non_send();
12 | - has type `impl Debug` which is not `Send`
13 LL | drop(x);
14 LL | fut().await;
15 | ^^^^^^^^^^^ await occurs here, with `x` maybe used later
16 LL | }
17 | - `x` is later dropped here
18 note: required by a bound in `assert_send`
19 --> $DIR/async-fn-nonsend.rs:46: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:51:17
26 |
27 LL | assert_send(non_send_temporary_in_match());
28 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `non_send_temporary_in_match` is not `Send`
29 |
30 = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `Rc<()>`
31 note: future is not `Send` as this value is used across an await
32 --> $DIR/async-fn-nonsend.rs:33:20
33 |
34 LL | match Some(non_send()) {
35 | ---------- has type `impl Debug` which is not `Send`
36 LL | Some(_) => fut().await,
37 | ^^^^^^^^^^^ await occurs here, with `non_send()` maybe used later
38 ...
39 LL | }
40 | - `non_send()` is later dropped here
41 note: required by a bound in `assert_send`
42 --> $DIR/async-fn-nonsend.rs:46:24
43 |
44 LL | fn assert_send(_: impl Send) {}
45 | ^^^^ required by this bound in `assert_send`
46
47 error: future cannot be sent between threads safely
48 --> $DIR/async-fn-nonsend.rs:53:17
49 |
50 LL | assert_send(non_sync_with_method_call());
51 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `non_sync_with_method_call` is not `Send`
52 |
53 = help: the trait `Send` is not implemented for `dyn std::fmt::Write`
54 note: future is not `Send` as this value is used across an await
55 --> $DIR/async-fn-nonsend.rs:42:9
56 |
57 LL | let f: &mut std::fmt::Formatter = panic!();
58 | - has type `&mut Formatter<'_>` which is not `Send`
59 LL | if non_sync().fmt(f).unwrap() == () {
60 LL | fut().await;
61 | ^^^^^^^^^^^ await occurs here, with `f` maybe used later
62 LL | }
63 LL | }
64 | - `f` is later dropped here
65 note: required by a bound in `assert_send`
66 --> $DIR/async-fn-nonsend.rs:46:24
67 |
68 LL | fn assert_send(_: impl Send) {}
69 | ^^^^ required by this bound in `assert_send`
70
71 error: aborting due to 3 previous errors
72