Point to full async fn for future

This commit is contained in:
Michael Goulet 2023-10-02 21:31:46 +00:00
parent 3169423ce9
commit 2c525fd758
2 changed files with 22 additions and 19 deletions

View File

@ -1,8 +1,8 @@
warning: future cannot be sent between threads safely warning: future cannot be sent between threads safely
--> $DIR/ice-10645.rs:5:35 --> $DIR/ice-10645.rs:5:1
| |
LL | pub async fn bar<'a, T: 'a>(_: T) {} LL | pub async fn bar<'a, T: 'a>(_: T) {}
| ^ future returned by `bar` is not `Send` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `bar` is not `Send`
| |
note: captured value is not `Send` note: captured value is not `Send`
--> $DIR/ice-10645.rs:5:29 --> $DIR/ice-10645.rs:5:29

View File

@ -1,8 +1,8 @@
error: future cannot be sent between threads safely error: future cannot be sent between threads safely
--> $DIR/future_not_send.rs:7:62 --> $DIR/future_not_send.rs:7:1
| |
LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool { LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
| ^^^^ future returned by `private_future` is not `Send` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `private_future` is not `Send`
| |
note: future is not `Send` as this value is used across an await note: future is not `Send` as this value is used across an await
--> $DIR/future_not_send.rs:9:20 --> $DIR/future_not_send.rs:9:20
@ -23,10 +23,10 @@ LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
= help: to override `-D warnings` add `#[allow(clippy::future_not_send)]` = help: to override `-D warnings` add `#[allow(clippy::future_not_send)]`
error: future cannot be sent between threads safely error: future cannot be sent between threads safely
--> $DIR/future_not_send.rs:12:42 --> $DIR/future_not_send.rs:12:1
| |
LL | pub async fn public_future(rc: Rc<[u8]>) { LL | pub async fn public_future(rc: Rc<[u8]>) {
| ^ future returned by `public_future` is not `Send` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `public_future` is not `Send`
| |
note: future is not `Send` as this value is used across an await note: future is not `Send` as this value is used across an await
--> $DIR/future_not_send.rs:14:20 --> $DIR/future_not_send.rs:14:20
@ -39,10 +39,10 @@ LL | async { true }.await;
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send` = note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
error: future cannot be sent between threads safely error: future cannot be sent between threads safely
--> $DIR/future_not_send.rs:21:63 --> $DIR/future_not_send.rs:21:1
| |
LL | async fn private_future2(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool { LL | async fn private_future2(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
| ^^^^ future returned by `private_future2` is not `Send` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `private_future2` is not `Send`
| |
note: captured value is not `Send` note: captured value is not `Send`
--> $DIR/future_not_send.rs:21:26 --> $DIR/future_not_send.rs:21:26
@ -58,10 +58,10 @@ LL | async fn private_future2(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
= note: `std::cell::Cell<usize>` doesn't implement `std::marker::Sync` = note: `std::cell::Cell<usize>` doesn't implement `std::marker::Sync`
error: future cannot be sent between threads safely error: future cannot be sent between threads safely
--> $DIR/future_not_send.rs:26:43 --> $DIR/future_not_send.rs:26:1
| |
LL | pub async fn public_future2(rc: Rc<[u8]>) {} LL | pub async fn public_future2(rc: Rc<[u8]>) {}
| ^ future returned by `public_future2` is not `Send` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `public_future2` is not `Send`
| |
note: captured value is not `Send` note: captured value is not `Send`
--> $DIR/future_not_send.rs:26:29 --> $DIR/future_not_send.rs:26:29
@ -71,10 +71,10 @@ LL | pub async fn public_future2(rc: Rc<[u8]>) {}
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send` = note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
error: future cannot be sent between threads safely error: future cannot be sent between threads safely
--> $DIR/future_not_send.rs:38:39 --> $DIR/future_not_send.rs:38:5
| |
LL | async fn private_future(&self) -> usize { LL | async fn private_future(&self) -> usize {
| ^^^^^ future returned by `private_future` is not `Send` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `private_future` is not `Send`
| |
note: future is not `Send` as this value is used across an await note: future is not `Send` as this value is used across an await
--> $DIR/future_not_send.rs:40:24 --> $DIR/future_not_send.rs:40:24
@ -87,10 +87,10 @@ LL | async { true }.await;
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Sync` = note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Sync`
error: future cannot be sent between threads safely error: future cannot be sent between threads safely
--> $DIR/future_not_send.rs:44:39 --> $DIR/future_not_send.rs:44:5
| |
LL | pub async fn public_future(&self) { LL | pub async fn public_future(&self) {
| ^ future returned by `public_future` is not `Send` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `public_future` is not `Send`
| |
note: captured value is not `Send` because `&` references cannot be sent unless their referent is `Sync` note: captured value is not `Send` because `&` references cannot be sent unless their referent is `Sync`
--> $DIR/future_not_send.rs:44:32 --> $DIR/future_not_send.rs:44:32
@ -100,10 +100,13 @@ LL | pub async fn public_future(&self) {
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Sync` = note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Sync`
error: future cannot be sent between threads safely error: future cannot be sent between threads safely
--> $DIR/future_not_send.rs:55:37 --> $DIR/future_not_send.rs:55:1
| |
LL | async fn generic_future<T>(t: T) -> T LL | / async fn generic_future<T>(t: T) -> T
| ^ future returned by `generic_future` is not `Send` LL | |
LL | | where
LL | | T: Send,
| |____________^ future returned by `generic_future` is not `Send`
| |
note: future is not `Send` as this value is used across an await note: future is not `Send` as this value is used across an await
--> $DIR/future_not_send.rs:61:20 --> $DIR/future_not_send.rs:61:20
@ -115,10 +118,10 @@ LL | async { true }.await;
= note: `T` doesn't implement `std::marker::Sync` = note: `T` doesn't implement `std::marker::Sync`
error: future cannot be sent between threads safely error: future cannot be sent between threads safely
--> $DIR/future_not_send.rs:73:34 --> $DIR/future_not_send.rs:73:1
| |
LL | async fn unclear_future<T>(t: T) {} LL | async fn unclear_future<T>(t: T) {}
| ^ future returned by `unclear_future` is not `Send` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `unclear_future` is not `Send`
| |
note: captured value is not `Send` note: captured value is not `Send`
--> $DIR/future_not_send.rs:73:28 --> $DIR/future_not_send.rs:73:28