1 error: future cannot be sent between threads safely
2 --> $DIR/future_not_send.rs:7: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: future is not `Send` as this value is used across an await
8 --> $DIR/future_not_send.rs:8:19
10 LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
11 | -- has type `std::rc::Rc<[u8]>` which is not `Send`
12 LL | async { true }.await
13 | ^^^^^^ await occurs here, with `rc` maybe used later
15 | - `rc` is later dropped here
16 = note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
17 note: future is not `Send` as this value is used across an await
18 --> $DIR/future_not_send.rs:8:19
20 LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
21 | ---- has type `&std::cell::Cell<usize>` which is not `Send`
22 LL | async { true }.await
23 | ^^^^^^ await occurs here, with `cell` maybe used later
25 | - `cell` is later dropped here
26 = note: `std::cell::Cell<usize>` doesn't implement `std::marker::Sync`
27 = note: `-D clippy::future-not-send` implied by `-D warnings`
29 error: future cannot be sent between threads safely
30 --> $DIR/future_not_send.rs:11: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:12:19
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:19: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:19: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:19: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:23: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:23: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:34: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:35:23
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:39: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:40:30
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:49: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:54:19
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:65: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:65: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