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 {
52 = note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
53 = note: `std::cell::Cell<usize>` doesn't implement `std::marker::Sync`
55 error: future cannot be sent between threads safely
56 --> $DIR/future_not_send.rs:24:43
58 LL | pub async fn public_future2(rc: Rc<[u8]>) {}
61 = note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
63 error: future cannot be sent between threads safely
64 --> $DIR/future_not_send.rs:35:39
66 LL | async fn private_future(&self) -> usize {
67 | ^^^^^ future returned by `private_future` is not `Send`
69 note: future is not `Send` as this value is used across an await
70 --> $DIR/future_not_send.rs:36:9
72 LL | async fn private_future(&self) -> usize {
73 | ----- has type `&Dummy` which is not `Send`
74 LL | async { true }.await;
75 | ^^^^^^^^^^^^^^^^^^^^ await occurs here, with `&self` maybe used later
78 | - `&self` is later dropped here
79 = note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Sync`
81 error: future cannot be sent between threads safely
82 --> $DIR/future_not_send.rs:40:39
84 LL | pub async fn public_future(&self) {
85 | ^ future returned by `public_future` is not `Send`
87 note: future is not `Send` as this value is used across an await
88 --> $DIR/future_not_send.rs:41:9
90 LL | pub async fn public_future(&self) {
91 | ----- has type `&Dummy` which is not `Send`
92 LL | self.private_future().await;
93 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ await occurs here, with `&self` maybe used later
95 | - `&self` is later dropped here
96 = note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Sync`
98 error: future cannot be sent between threads safely
99 --> $DIR/future_not_send.rs:50:37
101 LL | async fn generic_future<T>(t: T) -> T
102 | ^ future returned by `generic_future` is not `Send`
104 note: future is not `Send` as this value is used across an await
105 --> $DIR/future_not_send.rs:55:5
108 | -- has type `&T` which is not `Send`
109 LL | async { true }.await;
110 | ^^^^^^^^^^^^^^^^^^^^ await occurs here, with `rt` maybe used later
113 | - `rt` is later dropped here
114 = note: `T` doesn't implement `std::marker::Sync`
116 error: future cannot be sent between threads safely
117 --> $DIR/future_not_send.rs:66:34
119 LL | async fn unclear_future<T>(t: T) {}
122 = note: `T` doesn't implement `std::marker::Send`
124 error: aborting due to 8 previous errors