1 error: future cannot be sent between threads safely
2 --> $DIR/issue-68112.rs:34:5
4 LL | require_send(send_fut);
5 | ^^^^^^^^^^^^ future created by async block is not `Send`
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
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
17 LL | fn require_send(_: impl Send) {}
18 | ^^^^ required by this bound in `require_send`
20 error: future cannot be sent between threads safely
21 --> $DIR/issue-68112.rs:43:5
23 LL | require_send(send_fut);
24 | ^^^^^^^^^^^^ future created by async block is not `Send`
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
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
36 LL | fn require_send(_: impl Send) {}
37 | ^^^^ required by this bound in `require_send`
39 error[E0277]: `RefCell<i32>` cannot be shared between threads safely
40 --> $DIR/issue-68112.rs:62:5
42 LL | require_send(send_fut);
43 | ^^^^^^^^^^^^ `RefCell<i32>` cannot be shared between threads safely
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
51 LL | async fn ready2<T>(t: T) -> T {
52 | _______________________________^
56 note: required because it appears within the type `impl Future<Output = Arc<RefCell<i32>>>`
57 --> $DIR/issue-68112.rs:50:31
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
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;
72 note: required by a bound in `require_send`
73 --> $DIR/issue-68112.rs:11:25
75 LL | fn require_send(_: impl Send) {}
76 | ^^^^ required by this bound in `require_send`
78 error: aborting due to 3 previous errors
80 For more information about this error, try `rustc --explain E0277`.