1
1
error: 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
3
3
|
4
4
LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
5
5
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `private_future` is not `Send`
6
6
|
7
7
note: 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
9
9
|
10
10
LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
11
11
| -- has type `std::rc::Rc<[u8]>` which is not `Send`
@@ -14,7 +14,7 @@ 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
16
note: 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
18
18
|
19
19
LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
20
20
| ^^^^ 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 {
23
23
= help: to override `-D warnings` add `#[allow(clippy::future_not_send)]`
24
24
25
25
error: 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
27
27
|
28
28
LL | pub async fn public_future(rc: Rc<[u8]>) {
29
29
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `public_future` is not `Send`
30
30
|
31
31
note: 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
33
33
|
34
34
LL | pub async fn public_future(rc: Rc<[u8]>) {
35
35
| -- has type `std::rc::Rc<[u8]>` which is not `Send`
@@ -39,45 +39,45 @@ LL | async { true }.await;
39
39
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
40
40
41
41
error: 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
43
43
|
44
44
LL | async fn private_future2(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
45
45
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `private_future2` is not `Send`
46
46
|
47
47
note: captured value is not `Send`
48
- --> tests/ui/future_not_send.rs:21 :26
48
+ --> tests/ui/future_not_send.rs:22 :26
49
49
|
50
50
LL | async fn private_future2(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
51
51
| ^^ has type `std::rc::Rc<[u8]>` which is not `Send`
52
52
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
53
53
note: 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
55
55
|
56
56
LL | async fn private_future2(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
57
57
| ^^^^ has type `&std::cell::Cell<usize>` which is not `Send`, because `std::cell::Cell<usize>` is not `Sync`
58
58
= note: `std::cell::Cell<usize>` doesn't implement `std::marker::Sync`
59
59
60
60
error: 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
62
62
|
63
63
LL | pub async fn public_future2(rc: Rc<[u8]>) {}
64
64
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `public_future2` is not `Send`
65
65
|
66
66
note: captured value is not `Send`
67
- --> tests/ui/future_not_send.rs:26 :29
67
+ --> tests/ui/future_not_send.rs:27 :29
68
68
|
69
69
LL | pub async fn public_future2(rc: Rc<[u8]>) {}
70
70
| ^^ has type `std::rc::Rc<[u8]>` which is not `Send`
71
71
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
72
72
73
73
error: 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
75
75
|
76
76
LL | async fn private_future(&self) -> usize {
77
77
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `private_future` is not `Send`
78
78
|
79
79
note: 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
81
81
|
82
82
LL | async fn private_future(&self) -> usize {
83
83
| ----- has type `&Dummy` which is not `Send`
@@ -87,20 +87,20 @@ LL | async { true }.await;
87
87
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Sync`
88
88
89
89
error: 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
91
91
|
92
92
LL | pub async fn public_future(&self) {
93
93
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `public_future` is not `Send`
94
94
|
95
95
note: 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
97
97
|
98
98
LL | pub async fn public_future(&self) {
99
99
| ^^^^^ has type `&Dummy` which is not `Send`, because `Dummy` is not `Sync`
100
100
= note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Sync`
101
101
102
102
error: 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
104
104
|
105
105
LL | / async fn generic_future<T>(t: T) -> T
106
106
LL | |
@@ -109,7 +109,7 @@ LL | | T: Send,
109
109
| |____________^ future returned by `generic_future` is not `Send`
110
110
|
111
111
note: 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
113
113
|
114
114
LL | let rt = &t;
115
115
| -- has type `&T` which is not `Send`
@@ -118,17 +118,20 @@ LL | async { true }.await;
118
118
= note: `T` doesn't implement `std::marker::Sync`
119
119
120
120
error: 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
122
122
|
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`
125
125
|
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
128
128
|
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`
132
135
133
136
error: aborting due to 8 previous errors
134
137
0 commit comments