11error: future cannot be sent between threads safely
2- --> tests/ui/future_not_send.rs:7 :1
2+ --> tests/ui/future_not_send.rs:8 :1
33 |
44LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
55 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `private_future` is not `Send`
66 |
77note: future is not `Send` as this value is used across an await
8- --> tests/ui/future_not_send.rs:9 :20
8+ --> tests/ui/future_not_send.rs:10 :20
99 |
1010LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
1111 | -- has type `std::rc::Rc<[u8]>` which is not `Send`
@@ -14,7 +14,7 @@ LL | async { true }.await
1414 | ^^^^^ await occurs here, with `rc` maybe used later
1515 = note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
1616note: captured value is not `Send` because `&` references cannot be sent unless their referent is `Sync`
17- --> tests/ui/future_not_send.rs:7 :39
17+ --> tests/ui/future_not_send.rs:8 :39
1818 |
1919LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
2020 | ^^^^ has type `&std::cell::Cell<usize>` which is not `Send`, because `std::cell::Cell<usize>` is not `Sync`
@@ -23,13 +23,13 @@ LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
2323 = help: to override `-D warnings` add `#[allow(clippy::future_not_send)]`
2424
2525error: future cannot be sent between threads safely
26- --> tests/ui/future_not_send.rs:12 :1
26+ --> tests/ui/future_not_send.rs:13 :1
2727 |
2828LL | pub async fn public_future(rc: Rc<[u8]>) {
2929 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `public_future` is not `Send`
3030 |
3131note: future is not `Send` as this value is used across an await
32- --> tests/ui/future_not_send.rs:14 :20
32+ --> tests/ui/future_not_send.rs:15 :20
3333 |
3434LL | pub async fn public_future(rc: Rc<[u8]>) {
3535 | -- has type `std::rc::Rc<[u8]>` which is not `Send`
@@ -39,45 +39,45 @@ LL | async { true }.await;
3939 = note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
4040
4141error: future cannot be sent between threads safely
42- --> tests/ui/future_not_send.rs:21 :1
42+ --> tests/ui/future_not_send.rs:22 :1
4343 |
4444LL | async fn private_future2(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
4545 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `private_future2` is not `Send`
4646 |
4747note: captured value is not `Send`
48- --> tests/ui/future_not_send.rs:21 :26
48+ --> tests/ui/future_not_send.rs:22 :26
4949 |
5050LL | async fn private_future2(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
5151 | ^^ has type `std::rc::Rc<[u8]>` which is not `Send`
5252 = note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
5353note: captured value is not `Send` because `&` references cannot be sent unless their referent is `Sync`
54- --> tests/ui/future_not_send.rs:21 :40
54+ --> tests/ui/future_not_send.rs:22 :40
5555 |
5656LL | async fn private_future2(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
5757 | ^^^^ has type `&std::cell::Cell<usize>` which is not `Send`, because `std::cell::Cell<usize>` is not `Sync`
5858 = note: `std::cell::Cell<usize>` doesn't implement `std::marker::Sync`
5959
6060error: future cannot be sent between threads safely
61- --> tests/ui/future_not_send.rs:26 :1
61+ --> tests/ui/future_not_send.rs:27 :1
6262 |
6363LL | pub async fn public_future2(rc: Rc<[u8]>) {}
6464 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `public_future2` is not `Send`
6565 |
6666note: captured value is not `Send`
67- --> tests/ui/future_not_send.rs:26 :29
67+ --> tests/ui/future_not_send.rs:27 :29
6868 |
6969LL | pub async fn public_future2(rc: Rc<[u8]>) {}
7070 | ^^ has type `std::rc::Rc<[u8]>` which is not `Send`
7171 = note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
7272
7373error: future cannot be sent between threads safely
74- --> tests/ui/future_not_send.rs:38 :5
74+ --> tests/ui/future_not_send.rs:39 :5
7575 |
7676LL | async fn private_future(&self) -> usize {
7777 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `private_future` is not `Send`
7878 |
7979note: future is not `Send` as this value is used across an await
80- --> tests/ui/future_not_send.rs:40 :24
80+ --> tests/ui/future_not_send.rs:41 :24
8181 |
8282LL | async fn private_future(&self) -> usize {
8383 | ----- has type `&Dummy` which is not `Send`
@@ -87,20 +87,20 @@ LL | async { true }.await;
8787 = note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Sync`
8888
8989error: future cannot be sent between threads safely
90- --> tests/ui/future_not_send.rs:44 :5
90+ --> tests/ui/future_not_send.rs:45 :5
9191 |
9292LL | pub async fn public_future(&self) {
9393 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `public_future` is not `Send`
9494 |
9595note: captured value is not `Send` because `&` references cannot be sent unless their referent is `Sync`
96- --> tests/ui/future_not_send.rs:44 :32
96+ --> tests/ui/future_not_send.rs:45 :32
9797 |
9898LL | pub async fn public_future(&self) {
9999 | ^^^^^ has type `&Dummy` which is not `Send`, because `Dummy` is not `Sync`
100100 = note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Sync`
101101
102102error: future cannot be sent between threads safely
103- --> tests/ui/future_not_send.rs:55 :1
103+ --> tests/ui/future_not_send.rs:56 :1
104104 |
105105LL | / async fn generic_future<T>(t: T) -> T
106106LL | |
@@ -109,7 +109,7 @@ LL | | T: Send,
109109 | |____________^ future returned by `generic_future` is not `Send`
110110 |
111111note: future is not `Send` as this value is used across an await
112- --> tests/ui/future_not_send.rs:61 :20
112+ --> tests/ui/future_not_send.rs:62 :20
113113 |
114114LL | let rt = &t;
115115 | -- has type `&T` which is not `Send`
@@ -118,17 +118,20 @@ LL | async { true }.await;
118118 = note: `T` doesn't implement `std::marker::Sync`
119119
120120error: future cannot be sent between threads safely
121- --> tests/ui/future_not_send.rs:73 :1
121+ --> tests/ui/future_not_send.rs:78 :1
122122 |
123- LL | async fn unclear_future <T>(t: T ) {}
124- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `unclear_future ` is not `Send`
123+ LL | async fn generic_future_always_unsend <T>(_: Rc<T> ) {
124+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `generic_future_always_unsend ` is not `Send`
125125 |
126- note: captured value is not `Send`
127- --> tests/ui/future_not_send.rs:73:28
126+ note: future is not `Send` as this value is used across an await
127+ --> tests/ui/future_not_send.rs:80:20
128128 |
129- LL | async fn unclear_future<T>(t: T) {}
130- | ^ has type `T` which is not `Send`
131- = note: `T` doesn't implement `std::marker::Send`
129+ LL | async fn generic_future_always_unsend<T>(_: Rc<T>) {
130+ | - has type `std::rc::Rc<T>` which is not `Send`
131+ LL |
132+ LL | async { true }.await;
133+ | ^^^^^ await occurs here, with `_` maybe used later
134+ = note: `std::rc::Rc<T>` doesn't implement `std::marker::Send`
132135
133136error: aborting due to 8 previous errors
134137
0 commit comments