@@ -13,11 +13,14 @@ LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
13
13
LL | async { true }.await
14
14
| ^^^^^ await occurs here, with `rc` maybe used later
15
15
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
16
- note: captured value is not `Send` because `&` references cannot be sent unless their referent is `Sync`
17
- --> tests/ui/future_not_send.rs:8:39
16
+ note: future is not `Send` as this value is used across an await
17
+ --> tests/ui/future_not_send.rs:11:20
18
18
|
19
19
LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
20
- | ^^^^ has type `&std::cell::Cell<usize>` which is not `Send`, because `std::cell::Cell<usize>` is not `Sync`
20
+ | ---- has type `&std::cell::Cell<usize>` which is not `Send`
21
+ ...
22
+ LL | async { true }.await
23
+ | ^^^^^ await occurs here, with `cell` maybe used later
21
24
= note: `std::cell::Cell<usize>` doesn't implement `std::marker::Sync`
22
25
= note: `-D clippy::future-not-send` implied by `-D warnings`
23
26
= help: to override `-D warnings` add `#[allow(clippy::future_not_send)]`
@@ -92,11 +95,14 @@ error: future cannot be sent between threads safely
92
95
LL | pub async fn public_future(&self) {
93
96
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `public_future` is not `Send`
94
97
|
95
- note: captured value is not `Send` because `&` references cannot be sent unless their referent is `Sync`
96
- --> tests/ui/future_not_send.rs:49:32
98
+ note: future is not `Send` as this value is used across an await
99
+ --> tests/ui/future_not_send.rs:52:31
97
100
|
98
101
LL | pub async fn public_future(&self) {
99
- | ^^^^^ has type `&Dummy` which is not `Send`, because `Dummy` is not `Sync`
102
+ | ---- has type `&Dummy` which is not `Send`
103
+ ...
104
+ LL | self.private_future().await;
105
+ | ^^^^^ await occurs here, with `self` maybe used later
100
106
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Sync`
101
107
102
108
error: future cannot be sent between threads safely
0 commit comments