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