2020-04-07 08:39:07 -05:00
|
|
|
error: future cannot be sent between threads safely
|
2021-11-04 07:52:36 -05:00
|
|
|
--> $DIR/future_not_send.rs:7:62
|
2020-04-07 08:39:07 -05:00
|
|
|
|
|
|
|
|
LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
|
|
|
|
| ^^^^ future returned by `private_future` is not `Send`
|
|
|
|
|
|
|
|
|
= note: `-D clippy::future-not-send` implied by `-D warnings`
|
|
|
|
note: future is not `Send` as this value is used across an await
|
2021-12-10 11:20:57 -06:00
|
|
|
--> $DIR/future_not_send.rs:8:19
|
2020-04-07 08:39:07 -05:00
|
|
|
|
|
|
|
|
LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
|
|
|
|
| -- has type `std::rc::Rc<[u8]>` which is not `Send`
|
|
|
|
LL | async { true }.await
|
2021-12-10 11:20:57 -06:00
|
|
|
| ^^^^^^ await occurs here, with `rc` maybe used later
|
2020-04-07 08:39:07 -05:00
|
|
|
LL | }
|
|
|
|
| - `rc` is later dropped here
|
|
|
|
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
|
|
|
|
note: future is not `Send` as this value is used across an await
|
2021-12-10 11:20:57 -06:00
|
|
|
--> $DIR/future_not_send.rs:8:19
|
2020-04-07 08:39:07 -05:00
|
|
|
|
|
|
|
|
LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
|
|
|
|
| ---- has type `&std::cell::Cell<usize>` which is not `Send`
|
|
|
|
LL | async { true }.await
|
2021-12-10 11:20:57 -06:00
|
|
|
| ^^^^^^ await occurs here, with `cell` maybe used later
|
2020-04-07 08:39:07 -05:00
|
|
|
LL | }
|
|
|
|
| - `cell` is later dropped here
|
|
|
|
= note: `std::cell::Cell<usize>` doesn't implement `std::marker::Sync`
|
|
|
|
|
|
|
|
error: future cannot be sent between threads safely
|
2021-11-04 07:52:36 -05:00
|
|
|
--> $DIR/future_not_send.rs:11:42
|
2020-04-07 08:39:07 -05:00
|
|
|
|
|
|
|
|
LL | pub async fn public_future(rc: Rc<[u8]>) {
|
|
|
|
| ^ future returned by `public_future` is not `Send`
|
|
|
|
|
|
|
|
|
note: future is not `Send` as this value is used across an await
|
2021-12-10 11:20:57 -06:00
|
|
|
--> $DIR/future_not_send.rs:12:19
|
2020-04-07 08:39:07 -05:00
|
|
|
|
|
|
|
|
LL | pub async fn public_future(rc: Rc<[u8]>) {
|
|
|
|
| -- has type `std::rc::Rc<[u8]>` which is not `Send`
|
|
|
|
LL | async { true }.await;
|
2021-12-10 11:20:57 -06:00
|
|
|
| ^^^^^^ await occurs here, with `rc` maybe used later
|
2020-04-07 08:39:07 -05:00
|
|
|
LL | }
|
|
|
|
| - `rc` is later dropped here
|
|
|
|
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
|
|
|
|
|
|
|
|
error: future cannot be sent between threads safely
|
2021-11-04 07:52:36 -05:00
|
|
|
--> $DIR/future_not_send.rs:19:63
|
2020-04-07 08:39:07 -05:00
|
|
|
|
|
|
|
|
LL | async fn private_future2(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
|
2020-05-28 08:45:24 -05:00
|
|
|
| ^^^^ future returned by `private_future2` is not `Send`
|
2020-04-07 08:39:07 -05:00
|
|
|
|
|
2020-05-28 08:45:24 -05:00
|
|
|
note: captured value is not `Send`
|
2021-11-04 07:52:36 -05:00
|
|
|
--> $DIR/future_not_send.rs:19:26
|
2020-05-28 08:45:24 -05:00
|
|
|
|
|
|
|
|
LL | async fn private_future2(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
|
|
|
|
| ^^ has type `std::rc::Rc<[u8]>` which is not `Send`
|
2020-04-07 08:39:07 -05:00
|
|
|
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
|
2021-07-23 12:30:52 -05:00
|
|
|
note: captured value is not `Send` because `&` references cannot be sent unless their referent is `Sync`
|
2021-11-04 07:52:36 -05:00
|
|
|
--> $DIR/future_not_send.rs:19:40
|
2020-05-28 08:45:24 -05:00
|
|
|
|
|
|
|
|
LL | async fn private_future2(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
|
2021-07-23 12:30:52 -05:00
|
|
|
| ^^^^ has type `&std::cell::Cell<usize>` which is not `Send`, because `std::cell::Cell<usize>` is not `Sync`
|
2020-04-07 08:39:07 -05:00
|
|
|
= note: `std::cell::Cell<usize>` doesn't implement `std::marker::Sync`
|
|
|
|
|
|
|
|
error: future cannot be sent between threads safely
|
2021-11-04 07:52:36 -05:00
|
|
|
--> $DIR/future_not_send.rs:23:43
|
2020-04-07 08:39:07 -05:00
|
|
|
|
|
|
|
|
LL | pub async fn public_future2(rc: Rc<[u8]>) {}
|
2020-05-28 08:45:24 -05:00
|
|
|
| ^ future returned by `public_future2` is not `Send`
|
2020-04-07 08:39:07 -05:00
|
|
|
|
|
2020-05-28 08:45:24 -05:00
|
|
|
note: captured value is not `Send`
|
2021-11-04 07:52:36 -05:00
|
|
|
--> $DIR/future_not_send.rs:23:29
|
2020-05-28 08:45:24 -05:00
|
|
|
|
|
|
|
|
LL | pub async fn public_future2(rc: Rc<[u8]>) {}
|
|
|
|
| ^^ has type `std::rc::Rc<[u8]>` which is not `Send`
|
2020-04-07 08:39:07 -05:00
|
|
|
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
|
|
|
|
|
|
|
|
error: future cannot be sent between threads safely
|
2021-11-04 07:52:36 -05:00
|
|
|
--> $DIR/future_not_send.rs:34:39
|
2020-04-07 08:39:07 -05:00
|
|
|
|
|
|
|
|
LL | async fn private_future(&self) -> usize {
|
|
|
|
| ^^^^^ future returned by `private_future` is not `Send`
|
|
|
|
|
|
|
|
|
note: future is not `Send` as this value is used across an await
|
2021-12-10 11:20:57 -06:00
|
|
|
--> $DIR/future_not_send.rs:35:23
|
2020-04-07 08:39:07 -05:00
|
|
|
|
|
|
|
|
LL | async fn private_future(&self) -> usize {
|
|
|
|
| ----- has type `&Dummy` which is not `Send`
|
|
|
|
LL | async { true }.await;
|
2021-12-10 11:20:57 -06:00
|
|
|
| ^^^^^^ await occurs here, with `&self` maybe used later
|
2020-04-07 08:39:07 -05:00
|
|
|
LL | self.rc.len()
|
|
|
|
LL | }
|
|
|
|
| - `&self` is later dropped here
|
|
|
|
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Sync`
|
|
|
|
|
|
|
|
error: future cannot be sent between threads safely
|
2021-11-04 07:52:36 -05:00
|
|
|
--> $DIR/future_not_send.rs:39:39
|
2020-04-07 08:39:07 -05:00
|
|
|
|
|
|
|
|
LL | pub async fn public_future(&self) {
|
|
|
|
| ^ future returned by `public_future` is not `Send`
|
|
|
|
|
|
|
|
|
note: future is not `Send` as this value is used across an await
|
2021-12-10 11:20:57 -06:00
|
|
|
--> $DIR/future_not_send.rs:40:30
|
2020-04-07 08:39:07 -05:00
|
|
|
|
|
|
|
|
LL | pub async fn public_future(&self) {
|
|
|
|
| ----- has type `&Dummy` which is not `Send`
|
|
|
|
LL | self.private_future().await;
|
2021-12-10 11:20:57 -06:00
|
|
|
| ^^^^^^ await occurs here, with `&self` maybe used later
|
2020-04-07 08:39:07 -05:00
|
|
|
LL | }
|
|
|
|
| - `&self` is later dropped here
|
|
|
|
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Sync`
|
|
|
|
|
|
|
|
error: future cannot be sent between threads safely
|
2021-11-04 07:52:36 -05:00
|
|
|
--> $DIR/future_not_send.rs:49:37
|
2020-04-07 08:39:07 -05:00
|
|
|
|
|
|
|
|
LL | async fn generic_future<T>(t: T) -> T
|
|
|
|
| ^ future returned by `generic_future` is not `Send`
|
|
|
|
|
|
|
|
|
note: future is not `Send` as this value is used across an await
|
2021-12-10 11:20:57 -06:00
|
|
|
--> $DIR/future_not_send.rs:54:19
|
2020-04-07 08:39:07 -05:00
|
|
|
|
|
|
|
|
LL | let rt = &t;
|
|
|
|
| -- has type `&T` which is not `Send`
|
|
|
|
LL | async { true }.await;
|
2021-12-10 11:20:57 -06:00
|
|
|
| ^^^^^^ await occurs here, with `rt` maybe used later
|
2020-04-07 08:39:07 -05:00
|
|
|
LL | t
|
|
|
|
LL | }
|
|
|
|
| - `rt` is later dropped here
|
|
|
|
= note: `T` doesn't implement `std::marker::Sync`
|
|
|
|
|
|
|
|
error: future cannot be sent between threads safely
|
2021-11-04 07:52:36 -05:00
|
|
|
--> $DIR/future_not_send.rs:65:34
|
2020-04-07 08:39:07 -05:00
|
|
|
|
|
|
|
|
LL | async fn unclear_future<T>(t: T) {}
|
2020-05-28 08:45:24 -05:00
|
|
|
| ^ future returned by `unclear_future` is not `Send`
|
2020-04-07 08:39:07 -05:00
|
|
|
|
|
2020-05-28 08:45:24 -05:00
|
|
|
note: captured value is not `Send`
|
2021-11-04 07:52:36 -05:00
|
|
|
--> $DIR/future_not_send.rs:65:28
|
2020-05-28 08:45:24 -05:00
|
|
|
|
|
|
|
|
LL | async fn unclear_future<T>(t: T) {}
|
|
|
|
| ^ has type `T` which is not `Send`
|
2020-04-07 08:39:07 -05:00
|
|
|
= note: `T` doesn't implement `std::marker::Send`
|
|
|
|
|
|
|
|
error: aborting due to 8 previous errors
|
|
|
|
|