fork/rust

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

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

master
5.8 KiB134 linesraw
1error: future cannot be sent between threads safely
2  --> $DIR/future_not_send.rs:7:1
3   |
4LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
5   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `private_future` is not `Send`
6   |
7note: future is not `Send` as this value is used across an await
8  --> $DIR/future_not_send.rs:9:20
9   |
10LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
11   |                         -- has type `std::rc::Rc<[u8]>` which is not `Send`
12LL |
13LL |     async { true }.await
14   |                    ^^^^^ await occurs here, with `rc` maybe used later
15   = note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
16note: captured value is not `Send` because `&` references cannot be sent unless their referent is `Sync`
17  --> $DIR/future_not_send.rs:7:39
18   |
19LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
20   |                                       ^^^^ has type `&std::cell::Cell<usize>` which is not `Send`, because `std::cell::Cell<usize>` is not `Sync`
21   = note: `std::cell::Cell<usize>` doesn't implement `std::marker::Sync`
22   = note: `-D clippy::future-not-send` implied by `-D warnings`
23   = help: to override `-D warnings` add `#[allow(clippy::future_not_send)]`
24
25error: future cannot be sent between threads safely
26  --> $DIR/future_not_send.rs:12:1
27   |
28LL | pub async fn public_future(rc: Rc<[u8]>) {
29   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `public_future` is not `Send`
30   |
31note: future is not `Send` as this value is used across an await
32  --> $DIR/future_not_send.rs:14:20
33   |
34LL | pub async fn public_future(rc: Rc<[u8]>) {
35   |                            -- has type `std::rc::Rc<[u8]>` which is not `Send`
36LL |
37LL |     async { true }.await;
38   |                    ^^^^^ await occurs here, with `rc` maybe used later
39   = note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
40
41error: future cannot be sent between threads safely
42  --> $DIR/future_not_send.rs:21:1
43   |
44LL | async fn private_future2(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
45   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `private_future2` is not `Send`
46   |
47note: captured value is not `Send`
48  --> $DIR/future_not_send.rs:21:26
49   |
50LL | async fn private_future2(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
51   |                          ^^ has type `std::rc::Rc<[u8]>` which is not `Send`
52   = note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
53note: captured value is not `Send` because `&` references cannot be sent unless their referent is `Sync`
54  --> $DIR/future_not_send.rs:21:40
55   |
56LL | async fn private_future2(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
57   |                                        ^^^^ has type `&std::cell::Cell<usize>` which is not `Send`, because `std::cell::Cell<usize>` is not `Sync`
58   = note: `std::cell::Cell<usize>` doesn't implement `std::marker::Sync`
59
60error: future cannot be sent between threads safely
61  --> $DIR/future_not_send.rs:26:1
62   |
63LL | pub async fn public_future2(rc: Rc<[u8]>) {}
64   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `public_future2` is not `Send`
65   |
66note: captured value is not `Send`
67  --> $DIR/future_not_send.rs:26:29
68   |
69LL | pub async fn public_future2(rc: Rc<[u8]>) {}
70   |                             ^^ has type `std::rc::Rc<[u8]>` which is not `Send`
71   = note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
72
73error: future cannot be sent between threads safely
74  --> $DIR/future_not_send.rs:38:5
75   |
76LL |     async fn private_future(&self) -> usize {
77   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `private_future` is not `Send`
78   |
79note: future is not `Send` as this value is used across an await
80  --> $DIR/future_not_send.rs:40:24
81   |
82LL |     async fn private_future(&self) -> usize {
83   |                             ----- has type `&Dummy` which is not `Send`
84LL |
85LL |         async { true }.await;
86   |                        ^^^^^ await occurs here, with `&self` maybe used later
87   = note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Sync`
88
89error: future cannot be sent between threads safely
90  --> $DIR/future_not_send.rs:44:5
91   |
92LL |     pub async fn public_future(&self) {
93   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `public_future` is not `Send`
94   |
95note: captured value is not `Send` because `&` references cannot be sent unless their referent is `Sync`
96  --> $DIR/future_not_send.rs:44:32
97   |
98LL |     pub async fn public_future(&self) {
99   |                                ^^^^^ has type `&Dummy` which is not `Send`, because `Dummy` is not `Sync`
100   = note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Sync`
101
102error: future cannot be sent between threads safely
103  --> $DIR/future_not_send.rs:55:1
104   |
105LL | / async fn generic_future<T>(t: T) -> T
106LL | |
107LL | | where
108LL | |     T: Send,
109   | |____________^ future returned by `generic_future` is not `Send`
110   |
111note: future is not `Send` as this value is used across an await
112  --> $DIR/future_not_send.rs:61:20
113   |
114LL |     let rt = &t;
115   |         -- has type `&T` which is not `Send`
116LL |     async { true }.await;
117   |                    ^^^^^ await occurs here, with `rt` maybe used later
118   = note: `T` doesn't implement `std::marker::Sync`
119
120error: future cannot be sent between threads safely
121  --> $DIR/future_not_send.rs:73:1
122   |
123LL | async fn unclear_future<T>(t: T) {}
124   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `unclear_future` is not `Send`
125   |
126note: captured value is not `Send`
127  --> $DIR/future_not_send.rs:73:28
128   |
129LL | async fn unclear_future<T>(t: T) {}
130   |                            ^ has type `T` which is not `Send`
131   = note: `T` doesn't implement `std::marker::Send`
132
133error: aborting due to 8 previous errors
134