summaryrefslogtreecommitdiff
path: root/src/tools/clippy/tests/ui/future_not_send.stderr
blob: 5c6348962a5ebc6ba56034d415a0fda063f7d97a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
error: future cannot be sent between threads safely
  --> $DIR/future_not_send.rs:7:62
   |
LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
   |                                                              ^^^^ future returned by `private_future` is not `Send`
   |
note: future is not `Send` as this value is used across an await
  --> $DIR/future_not_send.rs:8:20
   |
LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
   |                         -- has type `std::rc::Rc<[u8]>` which is not `Send`
LL |     async { true }.await
   |                    ^^^^^ await occurs here, with `rc` maybe used later
LL | }
   | - `rc` is later dropped here
   = note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`
note: future is not `Send` as this value is used across an await
  --> $DIR/future_not_send.rs:8:20
   |
LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
   |                                       ---- has type `&std::cell::Cell<usize>` which is not `Send`
LL |     async { true }.await
   |                    ^^^^^ await occurs here, with `cell` maybe used later
LL | }
   | - `cell` is later dropped here
   = note: `std::cell::Cell<usize>` doesn't implement `std::marker::Sync`
   = note: `-D clippy::future-not-send` implied by `-D warnings`

error: future cannot be sent between threads safely
  --> $DIR/future_not_send.rs:11:42
   |
LL | pub async fn public_future(rc: Rc<[u8]>) {
   |                                          ^ future returned by `public_future` is not `Send`
   |
note: future is not `Send` as this value is used across an await
  --> $DIR/future_not_send.rs:12:20
   |
LL | pub async fn public_future(rc: Rc<[u8]>) {
   |                            -- has type `std::rc::Rc<[u8]>` which is not `Send`
LL |     async { true }.await;
   |                    ^^^^^ await occurs here, with `rc` maybe used later
LL | }
   | - `rc` is later dropped here
   = note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`

error: future cannot be sent between threads safely
  --> $DIR/future_not_send.rs:19:63
   |
LL | async fn private_future2(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
   |                                                               ^^^^ future returned by `private_future2` is not `Send`
   |
note: captured value is not `Send`
  --> $DIR/future_not_send.rs:19:26
   |
LL | async fn private_future2(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
   |                          ^^ has type `std::rc::Rc<[u8]>` which is not `Send`
   = 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`
  --> $DIR/future_not_send.rs:19: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`
   = note: `std::cell::Cell<usize>` doesn't implement `std::marker::Sync`

error: future cannot be sent between threads safely
  --> $DIR/future_not_send.rs:23:43
   |
LL | pub async fn public_future2(rc: Rc<[u8]>) {}
   |                                           ^ future returned by `public_future2` is not `Send`
   |
note: captured value is not `Send`
  --> $DIR/future_not_send.rs:23:29
   |
LL | pub async fn public_future2(rc: Rc<[u8]>) {}
   |                             ^^ has type `std::rc::Rc<[u8]>` which is not `Send`
   = note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Send`

error: future cannot be sent between threads safely
  --> $DIR/future_not_send.rs:34:39
   |
LL |     async fn private_future(&self) -> usize {
   |                                       ^^^^^ future returned by `private_future` is not `Send`
   |
note: future is not `Send` as this value is used across an await
  --> $DIR/future_not_send.rs:35:24
   |
LL |     async fn private_future(&self) -> usize {
   |                             ----- has type `&Dummy` which is not `Send`
LL |         async { true }.await;
   |                        ^^^^^ await occurs here, with `&self` maybe used later
LL |         self.rc.len()
LL |     }
   |     - `&self` is later dropped here
   = note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Sync`

error: future cannot be sent between threads safely
  --> $DIR/future_not_send.rs:39:39
   |
LL |     pub async fn public_future(&self) {
   |                                       ^ future returned by `public_future` is not `Send`
   |
note: future is not `Send` as this value is used across an await
  --> $DIR/future_not_send.rs:40:31
   |
LL |     pub async fn public_future(&self) {
   |                                ----- has type `&Dummy` which is not `Send`
LL |         self.private_future().await;
   |                               ^^^^^ await occurs here, with `&self` maybe used later
LL |     }
   |     - `&self` is later dropped here
   = note: `std::rc::Rc<[u8]>` doesn't implement `std::marker::Sync`

error: future cannot be sent between threads safely
  --> $DIR/future_not_send.rs:49:37
   |
LL | async fn generic_future<T>(t: T) -> T
   |                                     ^ future returned by `generic_future` is not `Send`
   |
note: future is not `Send` as this value is used across an await
  --> $DIR/future_not_send.rs:54:20
   |
LL |     let rt = &t;
   |         -- has type `&T` which is not `Send`
LL |     async { true }.await;
   |                    ^^^^^ await occurs here, with `rt` maybe used later
LL |     t
LL | }
   | - `rt` is later dropped here
   = note: `T` doesn't implement `std::marker::Sync`

error: future cannot be sent between threads safely
  --> $DIR/future_not_send.rs:65:34
   |
LL | async fn unclear_future<T>(t: T) {}
   |                                  ^ future returned by `unclear_future` is not `Send`
   |
note: captured value is not `Send`
  --> $DIR/future_not_send.rs:65:28
   |
LL | async fn unclear_future<T>(t: T) {}
   |                            ^ has type `T` which is not `Send`
   = note: `T` doesn't implement `std::marker::Send`

error: aborting due to 8 previous errors