]> git.proxmox.com Git - rustc.git/blob - tests/ui/async-await/issue-68112.stderr
New upstream version 1.74.1+dfsg1
[rustc.git] / tests / ui / async-await / issue-68112.stderr
1 error: future cannot be sent between threads safely
2 --> $DIR/issue-68112.rs:34:5
3 |
4 LL | require_send(send_fut);
5 | ^^^^^^^^^^^^ future created by async block is not `Send`
6 |
7 = help: the trait `Sync` is not implemented for `RefCell<i32>`
8 = note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead
9 note: future is not `Send` as it awaits another future which is not `Send`
10 --> $DIR/issue-68112.rs:31:17
11 |
12 LL | let _ = non_send_fut.await;
13 | ^^^^^^^^^^^^ await occurs here on type `impl Future<Output = Arc<RefCell<i32>>>`, which is not `Send`
14 note: required by a bound in `require_send`
15 --> $DIR/issue-68112.rs:11:25
16 |
17 LL | fn require_send(_: impl Send) {}
18 | ^^^^ required by this bound in `require_send`
19
20 error: future cannot be sent between threads safely
21 --> $DIR/issue-68112.rs:43:5
22 |
23 LL | require_send(send_fut);
24 | ^^^^^^^^^^^^ future created by async block is not `Send`
25 |
26 = help: the trait `Sync` is not implemented for `RefCell<i32>`
27 = note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead
28 note: future is not `Send` as it awaits another future which is not `Send`
29 --> $DIR/issue-68112.rs:40:17
30 |
31 LL | let _ = make_non_send_future1().await;
32 | ^^^^^^^^^^^^^^^^^^^^^^^ await occurs here on type `impl Future<Output = Arc<RefCell<i32>>>`, which is not `Send`
33 note: required by a bound in `require_send`
34 --> $DIR/issue-68112.rs:11:25
35 |
36 LL | fn require_send(_: impl Send) {}
37 | ^^^^ required by this bound in `require_send`
38
39 error[E0277]: `RefCell<i32>` cannot be shared between threads safely
40 --> $DIR/issue-68112.rs:62:5
41 |
42 LL | require_send(send_fut);
43 | ^^^^^^^^^^^^ `RefCell<i32>` cannot be shared between threads safely
44 |
45 = help: the trait `Sync` is not implemented for `RefCell<i32>`
46 = note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead
47 = note: required for `Arc<RefCell<i32>>` to implement `Send`
48 note: required because it's used within this `async fn` body
49 --> $DIR/issue-68112.rs:47:31
50 |
51 LL | async fn ready2<T>(t: T) -> T {
52 | _______________________________^
53 LL | | t
54 LL | | }
55 | |_^
56 note: required because it appears within the type `impl Future<Output = Arc<RefCell<i32>>>`
57 --> $DIR/issue-68112.rs:50:31
58 |
59 LL | fn make_non_send_future2() -> impl Future<Output = Arc<RefCell<i32>>> {
60 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
61 = note: required because it captures the following types: `impl Future<Output = Arc<RefCell<i32>>>`, `Ready<i32>`
62 note: required because it's used within this `async` block
63 --> $DIR/issue-68112.rs:57:20
64 |
65 LL | let send_fut = async {
66 | ____________________^
67 LL | | let non_send_fut = make_non_send_future2();
68 LL | | let _ = non_send_fut.await;
69 LL | | ready(0).await;
70 LL | | };
71 | |_____^
72 note: required by a bound in `require_send`
73 --> $DIR/issue-68112.rs:11:25
74 |
75 LL | fn require_send(_: impl Send) {}
76 | ^^^^ required by this bound in `require_send`
77
78 error: aborting due to 3 previous errors
79
80 For more information about this error, try `rustc --explain E0277`.