rust-clippy/tests/ui/future_not_send.stderr

135 lines
5.9 KiB
Text
Raw Normal View History

2020-04-07 13:39:07 +00:00
error: future cannot be sent between threads safely
2024-02-17 12:16:29 +00:00
--> tests/ui/future_not_send.rs:7:1
2020-04-07 13:39:07 +00:00
|
LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
2023-10-02 21:31:46 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `private_future` is not `Send`
2020-04-07 13:39:07 +00:00
|
note: future is not `Send` as this value is used across an await
2024-02-17 12:16:29 +00:00
--> tests/ui/future_not_send.rs:9:20
2020-04-07 13:39:07 +00:00
|
LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
| -- has type `std::rc::Rc<[u8]>` which is not `Send`
LL |
2020-04-07 13:39:07 +00:00
LL | async { true }.await
2023-04-25 19:52:17 +00:00
| ^^^^^ await occurs here, with `rc` maybe used later
2020-04-07 13:39:07 +00:00
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
2023-01-28 23:20:02 +00:00
note: captured value is not `Send` because `&` references cannot be sent unless their referent is `Sync`
2024-02-17 12:16:29 +00:00
--> tests/ui/future_not_send.rs:7:39
2020-04-07 13:39:07 +00:00
|
LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
2023-01-28 23:20:02 +00:00
| ^^^^ has type `&std::cell::Cell<usize>` which is not `Send`, because `std::cell::Cell<usize>` is not `Sync`
2020-04-07 13:39:07 +00:00
= note: `std::cell::Cell<usize>` doesn't implement `std::marker::Sync`
2022-09-22 16:04:22 +00:00
= note: `-D clippy::future-not-send` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::future_not_send)]`
2020-04-07 13:39:07 +00:00
error: future cannot be sent between threads safely
2024-02-17 12:16:29 +00:00
--> tests/ui/future_not_send.rs:12:1
2020-04-07 13:39:07 +00:00
|
LL | pub async fn public_future(rc: Rc<[u8]>) {
2023-10-02 21:31:46 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `public_future` is not `Send`
2020-04-07 13:39:07 +00:00
|
note: future is not `Send` as this value is used across an await
2024-02-17 12:16:29 +00:00
--> tests/ui/future_not_send.rs:14:20
2020-04-07 13:39:07 +00:00
|
LL | pub async fn public_future(rc: Rc<[u8]>) {
| -- has type `std::rc::Rc<[u8]>` which is not `Send`
LL |
2020-04-07 13:39:07 +00:00
LL | async { true }.await;
2023-04-25 19:52:17 +00:00
| ^^^^^ await occurs here, with `rc` maybe used later
2020-04-07 13:39:07 +00:00
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
error: future cannot be sent between threads safely
2024-02-17 12:16:29 +00:00
--> tests/ui/future_not_send.rs:21:1
2020-04-07 13:39:07 +00:00
|
LL | async fn private_future2(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
2023-10-02 21:31:46 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `private_future2` is not `Send`
2020-04-07 13:39:07 +00:00
|
note: captured value is not `Send`
2024-02-17 12:16:29 +00:00
--> tests/ui/future_not_send.rs:21:26
|
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 13:39:07 +00:00
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
note: captured value is not `Send` because `&` references cannot be sent unless their referent is `Sync`
2024-02-17 12:16:29 +00:00
--> tests/ui/future_not_send.rs:21:40
|
LL | async fn private_future2(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
| ^^^^ has type `&std::cell::Cell<usize>` which is not `Send`, because `std::cell::Cell<usize>` is not `Sync`
2020-04-07 13:39:07 +00:00
= note: `std::cell::Cell<usize>` doesn't implement `std::marker::Sync`
error: future cannot be sent between threads safely
2024-02-17 12:16:29 +00:00
--> tests/ui/future_not_send.rs:26:1
2020-04-07 13:39:07 +00:00
|
LL | pub async fn public_future2(rc: Rc<[u8]>) {}
2023-10-02 21:31:46 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `public_future2` is not `Send`
2020-04-07 13:39:07 +00:00
|
note: captured value is not `Send`
2024-02-17 12:16:29 +00:00
--> tests/ui/future_not_send.rs:26:29
|
LL | pub async fn public_future2(rc: Rc<[u8]>) {}
| ^^ has type `std::rc::Rc<[u8]>` which is not `Send`
2020-04-07 13:39:07 +00:00
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
error: future cannot be sent between threads safely
2024-02-17 12:16:29 +00:00
--> tests/ui/future_not_send.rs:38:5
2020-04-07 13:39:07 +00:00
|
LL | async fn private_future(&self) -> usize {
2023-10-02 21:31:46 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `private_future` is not `Send`
2020-04-07 13:39:07 +00:00
|
note: future is not `Send` as this value is used across an await
2024-02-17 12:16:29 +00:00
--> tests/ui/future_not_send.rs:40:24
2020-04-07 13:39:07 +00:00
|
LL | async fn private_future(&self) -> usize {
| ----- has type `&Dummy` which is not `Send`
LL |
2020-04-07 13:39:07 +00:00
LL | async { true }.await;
2023-04-25 19:52:17 +00:00
| ^^^^^ await occurs here, with `&self` maybe used later
2020-04-07 13:39:07 +00:00
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Sync`
error: future cannot be sent between threads safely
2024-02-17 12:16:29 +00:00
--> tests/ui/future_not_send.rs:44:5
2020-04-07 13:39:07 +00:00
|
LL | pub async fn public_future(&self) {
2023-10-02 21:31:46 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `public_future` is not `Send`
2020-04-07 13:39:07 +00:00
|
2023-01-28 23:20:02 +00:00
note: captured value is not `Send` because `&` references cannot be sent unless their referent is `Sync`
2024-02-17 12:16:29 +00:00
--> tests/ui/future_not_send.rs:44:32
2020-04-07 13:39:07 +00:00
|
LL | pub async fn public_future(&self) {
2023-01-28 23:20:02 +00:00
| ^^^^^ has type `&Dummy` which is not `Send`, because `Dummy` is not `Sync`
2020-04-07 13:39:07 +00:00
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Sync`
error: future cannot be sent between threads safely
2024-02-17 12:16:29 +00:00
--> tests/ui/future_not_send.rs:55:1
2020-04-07 13:39:07 +00:00
|
2023-10-02 21:31:46 +00:00
LL | / async fn generic_future<T>(t: T) -> T
LL | |
LL | | where
LL | | T: Send,
| |____________^ future returned by `generic_future` is not `Send`
2020-04-07 13:39:07 +00:00
|
note: future is not `Send` as this value is used across an await
2024-02-17 12:16:29 +00:00
--> tests/ui/future_not_send.rs:61:20
2020-04-07 13:39:07 +00:00
|
LL | let rt = &t;
| -- has type `&T` which is not `Send`
LL | async { true }.await;
2023-04-25 19:52:17 +00:00
| ^^^^^ await occurs here, with `rt` maybe used later
2020-04-07 13:39:07 +00:00
= note: `T` doesn't implement `std::marker::Sync`
error: future cannot be sent between threads safely
2024-02-17 12:16:29 +00:00
--> tests/ui/future_not_send.rs:73:1
2020-04-07 13:39:07 +00:00
|
LL | async fn unclear_future<T>(t: T) {}
2023-10-02 21:31:46 +00:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `unclear_future` is not `Send`
2020-04-07 13:39:07 +00:00
|
note: captured value is not `Send`
2024-02-17 12:16:29 +00:00
--> tests/ui/future_not_send.rs:73:28
|
LL | async fn unclear_future<T>(t: T) {}
| ^ has type `T` which is not `Send`
2020-04-07 13:39:07 +00:00
= note: `T` doesn't implement `std::marker::Send`
error: aborting due to 8 previous errors