]> git.lizzy.rs Git - rust.git/blob - tests/ui/async-await/issue-68112.drop_tracking.stderr
Add `rustc_on_unimplemented` on `Sync` for cell types
[rust.git] / tests / ui / async-await / issue-68112.drop_tracking.stderr
1 error: future cannot be sent between threads safely
2   --> $DIR/issue-68112.rs:37:18
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:34: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:14: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:46:18
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:43: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:14: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:65:18
41    |
42 LL |     require_send(send_fut);
43    |     ------------ ^^^^^^^^ `RefCell<i32>` cannot be shared between threads safely
44    |     |
45    |     required by a bound introduced by this call
46    |
47    = help: the trait `Sync` is not implemented for `RefCell<i32>`
48    = note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` instead
49    = note: required for `Arc<RefCell<i32>>` to implement `Send`
50 note: required because it's used within this `async fn` body
51   --> $DIR/issue-68112.rs:50:31
52    |
53 LL |   async fn ready2<T>(t: T) -> T {
54    |  _______________________________^
55 LL | |     t
56 LL | | }
57    | |_^
58 note: required because it appears within the type `impl Future<Output = Arc<RefCell<i32>>>`
59   --> $DIR/issue-68112.rs:53:31
60    |
61 LL | fn make_non_send_future2() -> impl Future<Output = Arc<RefCell<i32>>> {
62    |                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
63    = note: required because it captures the following types: `ResumeTy`, `impl Future<Output = Arc<RefCell<i32>>>`, `()`, `Ready<i32>`
64 note: required because it's used within this `async` block
65   --> $DIR/issue-68112.rs:60:20
66    |
67 LL |       let send_fut = async {
68    |  ____________________^
69 LL | |         let non_send_fut = make_non_send_future2();
70 LL | |         let _ = non_send_fut.await;
71 LL | |         ready(0).await;
72 LL | |     };
73    | |_____^
74 note: required by a bound in `require_send`
75   --> $DIR/issue-68112.rs:14:25
76    |
77 LL | fn require_send(_: impl Send) {}
78    |                         ^^^^ required by this bound in `require_send`
79
80 error: aborting due to 3 previous errors
81
82 For more information about this error, try `rustc --explain E0277`.