fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
3.3 KiB80 linesraw
1error: future cannot be sent between threads safely
2  --> $DIR/issue-68112.rs:34:5
3   |
4LL |     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
9note: future is not `Send` as it awaits another future which is not `Send`
10  --> $DIR/issue-68112.rs:31:17
11   |
12LL |         let _ = non_send_fut.await;
13   |                 ^^^^^^^^^^^^ await occurs here on type `impl Future<Output = Arc<RefCell<i32>>>`, which is not `Send`
14note: required by a bound in `require_send`
15  --> $DIR/issue-68112.rs:11:25
16   |
17LL | fn require_send(_: impl Send) {}
18   |                         ^^^^ required by this bound in `require_send`
19
20error: future cannot be sent between threads safely
21  --> $DIR/issue-68112.rs:43:5
22   |
23LL |     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
28note: future is not `Send` as it awaits another future which is not `Send`
29  --> $DIR/issue-68112.rs:40:17
30   |
31LL |         let _ = make_non_send_future1().await;
32   |                 ^^^^^^^^^^^^^^^^^^^^^^^ await occurs here on type `impl Future<Output = Arc<RefCell<i32>>>`, which is not `Send`
33note: required by a bound in `require_send`
34  --> $DIR/issue-68112.rs:11:25
35   |
36LL | fn require_send(_: impl Send) {}
37   |                         ^^^^ required by this bound in `require_send`
38
39error[E0277]: `RefCell<i32>` cannot be shared between threads safely
40  --> $DIR/issue-68112.rs:62:5
41   |
42LL |     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`
48note: required because it's used within this `async fn` body
49  --> $DIR/issue-68112.rs:47:31
50   |
51LL |   async fn ready2<T>(t: T) -> T {
52   |  _______________________________^
53LL | |     t
54LL | | }
55   | |_^
56note: required because it appears within the type `impl Future<Output = Arc<RefCell<i32>>>`
57  --> $DIR/issue-68112.rs:50:31
58   |
59LL | 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>`
62note: required because it's used within this `async` block
63  --> $DIR/issue-68112.rs:57:20
64   |
65LL |       let send_fut = async {
66   |  ____________________^
67LL | |         let non_send_fut = make_non_send_future2();
68LL | |         let _ = non_send_fut.await;
69LL | |         ready(0).await;
70LL | |     };
71   | |_____^
72note: required by a bound in `require_send`
73  --> $DIR/issue-68112.rs:11:25
74   |
75LL | fn require_send(_: impl Send) {}
76   |                         ^^^^ required by this bound in `require_send`
77
78error: aborting due to 3 previous errors
79
80For more information about this error, try `rustc --explain E0277`.