1 error: future cannot be sent between threads safely
2 --> $DIR/future_not_send.rs:8:62
4 LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
5 | ^^^^ future returned by `private_future` is not `Send`
7 = note: `-D clippy::future-not-send` implied by `-D warnings`
8 note: future is not `Send` as this value is used across an await
9 --> $DIR/future_not_send.rs:9:5
11 LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
12 | -- has type `std::rc::Rc<[u8]>` which is not `Send`
13 LL | async { true }.await
14 | ^^^^^^^^^^^^^^^^^^^^ await occurs here, with `rc` maybe used later
16 | - `rc` is later dropped here
17 = note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
18 note: future is not `Send` as this value is used across an await
19 --> $DIR/future_not_send.rs:9:5
21 LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
22 | ---- has type `&std::cell::Cell<usize>` which is not `Send`
23 LL | async { true }.await
24 | ^^^^^^^^^^^^^^^^^^^^ await occurs here, with `cell` maybe used later
26 | - `cell` is later dropped here
27 = note: `std::cell::Cell<usize>` doesn't implement `std::marker::Sync`
29 error: future cannot be sent between threads safely
30 --> $DIR/future_not_send.rs:12:42
32 LL | pub async fn public_future(rc: Rc<[u8]>) {
33 | ^ future returned by `public_future` is not `Send`
35 note: future is not `Send` as this value is used across an await
36 --> $DIR/future_not_send.rs:13:5
38 LL | pub async fn public_future(rc: Rc<[u8]>) {
39 | -- has type `std::rc::Rc<[u8]>` which is not `Send`
40 LL | async { true }.await;
41 | ^^^^^^^^^^^^^^^^^^^^ await occurs here, with `rc` maybe used later
43 | - `rc` is later dropped here
44 = note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
46 error: future cannot be sent between threads safely
47 --> $DIR/future_not_send.rs:20:63
49 LL | async fn private_future2(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
50 | ^^^^ future returned by `private_future2` is not `Send`
52 note: captured value is not `Send`
53 --> $DIR/future_not_send.rs:20:26
55 LL | async fn private_future2(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
56 | ^^ has type `std::rc::Rc<[u8]>` which is not `Send`
57 = note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
58 note: captured value is not `Send` because `&` references cannot be sent unless their referent is `Sync`
59 --> $DIR/future_not_send.rs:20:40
61 LL | async fn private_future2(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
62 | ^^^^ has type `&std::cell::Cell<usize>` which is not `Send`, because `std::cell::Cell<usize>` is not `Sync`
63 = note: `std::cell::Cell<usize>` doesn't implement `std::marker::Sync`
65 error: future cannot be sent between threads safely
66 --> $DIR/future_not_send.rs:24:43
68 LL | pub async fn public_future2(rc: Rc<[u8]>) {}
69 | ^ future returned by `public_future2` is not `Send`
71 note: captured value is not `Send`
72 --> $DIR/future_not_send.rs:24:29
74 LL | pub async fn public_future2(rc: Rc<[u8]>) {}
75 | ^^ has type `std::rc::Rc<[u8]>` which is not `Send`
76 = note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
78 error: future cannot be sent between threads safely
79 --> $DIR/future_not_send.rs:35:39
81 LL | async fn private_future(&self) -> usize {
82 | ^^^^^ future returned by `private_future` is not `Send`
84 note: future is not `Send` as this value is used across an await
85 --> $DIR/future_not_send.rs:36:9
87 LL | async fn private_future(&self) -> usize {
88 | ----- has type `&Dummy` which is not `Send`
89 LL | async { true }.await;
90 | ^^^^^^^^^^^^^^^^^^^^ await occurs here, with `&self` maybe used later
93 | - `&self` is later dropped here
94 = note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Sync`
96 error: future cannot be sent between threads safely
97 --> $DIR/future_not_send.rs:40:39
99 LL | pub async fn public_future(&self) {
100 | ^ future returned by `public_future` is not `Send`
102 note: future is not `Send` as this value is used across an await
103 --> $DIR/future_not_send.rs:41:9
105 LL | pub async fn public_future(&self) {
106 | ----- has type `&Dummy` which is not `Send`
107 LL | self.private_future().await;
108 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ await occurs here, with `&self` maybe used later
110 | - `&self` is later dropped here
111 = note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Sync`
113 error: future cannot be sent between threads safely
114 --> $DIR/future_not_send.rs:50:37
116 LL | async fn generic_future<T>(t: T) -> T
117 | ^ future returned by `generic_future` is not `Send`
119 note: future is not `Send` as this value is used across an await
120 --> $DIR/future_not_send.rs:55:5
123 | -- has type `&T` which is not `Send`
124 LL | async { true }.await;
125 | ^^^^^^^^^^^^^^^^^^^^ await occurs here, with `rt` maybe used later
128 | - `rt` is later dropped here
129 = note: `T` doesn't implement `std::marker::Sync`
131 error: future cannot be sent between threads safely
132 --> $DIR/future_not_send.rs:66:34
134 LL | async fn unclear_future<T>(t: T) {}
135 | ^ future returned by `unclear_future` is not `Send`
137 note: captured value is not `Send`
138 --> $DIR/future_not_send.rs:66:28
140 LL | async fn unclear_future<T>(t: T) {}
141 | ^ has type `T` which is not `Send`
142 = note: `T` doesn't implement `std::marker::Send`
144 error: aborting due to 8 previous errors