]> git.lizzy.rs Git - rust.git/blob - tests/ui/significant_drop_in_scrutinee.stderr
Fix `#[expect]` for `clippy::ptr_arg`
[rust.git] / tests / ui / significant_drop_in_scrutinee.stderr
1 error: temporary with significant drop in match scrutinee
2   --> $DIR/significant_drop_in_scrutinee.rs:59:11
3    |
4 LL |     match mutex.lock().unwrap().foo() {
5    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
6    |
7    = note: `-D clippy::significant-drop-in-scrutinee` implied by `-D warnings`
8 help: try moving the temporary above the match
9    |
10 LL ~     let value = mutex.lock().unwrap().foo();
11 LL ~     match value {
12    |
13
14 error: temporary with significant drop in match scrutinee
15   --> $DIR/significant_drop_in_scrutinee.rs:132:11
16    |
17 LL |     match s.lock_m().get_the_value() {
18    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^
19    |
20 help: try moving the temporary above the match
21    |
22 LL ~     let value = s.lock_m().get_the_value();
23 LL ~     match value {
24    |
25
26 error: temporary with significant drop in match scrutinee
27   --> $DIR/significant_drop_in_scrutinee.rs:153:11
28    |
29 LL |     match s.lock_m_m().get_the_value() {
30    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
31    |
32 help: try moving the temporary above the match
33    |
34 LL ~     let value = s.lock_m_m().get_the_value();
35 LL ~     match value {
36    |
37
38 error: temporary with significant drop in match scrutinee
39   --> $DIR/significant_drop_in_scrutinee.rs:201:11
40    |
41 LL |     match counter.temp_increment().len() {
42    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
43    |
44 help: try moving the temporary above the match
45    |
46 LL ~     let value = counter.temp_increment().len();
47 LL ~     match value {
48    |
49
50 error: temporary with significant drop in match scrutinee
51   --> $DIR/significant_drop_in_scrutinee.rs:224:16
52    |
53 LL |         match (mutex1.lock().unwrap().s.len(), true) {
54    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
55    |
56 help: try moving the temporary above the match
57    |
58 LL ~         let value = mutex1.lock().unwrap().s.len();
59 LL ~         match (value, true) {
60    |
61
62 error: temporary with significant drop in match scrutinee
63   --> $DIR/significant_drop_in_scrutinee.rs:233:22
64    |
65 LL |         match (true, mutex1.lock().unwrap().s.len(), true) {
66    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
67    |
68 help: try moving the temporary above the match
69    |
70 LL ~         let value = mutex1.lock().unwrap().s.len();
71 LL ~         match (true, value, true) {
72    |
73
74 error: temporary with significant drop in match scrutinee
75   --> $DIR/significant_drop_in_scrutinee.rs:243:16
76    |
77 LL |         match (mutex1.lock().unwrap().s.len(), true, mutex2.lock().unwrap().s.len()) {
78    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
79    |
80 help: try moving the temporary above the match
81    |
82 LL ~         let value = mutex1.lock().unwrap().s.len();
83 LL ~         match (value, true, mutex2.lock().unwrap().s.len()) {
84    |
85
86 error: temporary with significant drop in match scrutinee
87   --> $DIR/significant_drop_in_scrutinee.rs:243:54
88    |
89 LL |         match (mutex1.lock().unwrap().s.len(), true, mutex2.lock().unwrap().s.len()) {
90    |                                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
91    |
92 help: try moving the temporary above the match
93    |
94 LL ~         let value = mutex2.lock().unwrap().s.len();
95 LL ~         match (mutex1.lock().unwrap().s.len(), true, value) {
96    |
97
98 error: temporary with significant drop in match scrutinee
99   --> $DIR/significant_drop_in_scrutinee.rs:254:15
100    |
101 LL |         match mutex3.lock().unwrap().s.as_str() {
102    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
103
104 error: temporary with significant drop in match scrutinee
105   --> $DIR/significant_drop_in_scrutinee.rs:264:22
106    |
107 LL |         match (true, mutex3.lock().unwrap().s.as_str()) {
108    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
109
110 error: temporary with significant drop in match scrutinee
111   --> $DIR/significant_drop_in_scrutinee.rs:283:11
112    |
113 LL |     match mutex.lock().unwrap().s.len() > 1 {
114    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
115    |
116 help: try moving the temporary above the match
117    |
118 LL ~     let value = mutex.lock().unwrap().s.len() > 1;
119 LL ~     match value {
120    |
121
122 error: temporary with significant drop in match scrutinee
123   --> $DIR/significant_drop_in_scrutinee.rs:290:11
124    |
125 LL |     match 1 < mutex.lock().unwrap().s.len() {
126    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
127    |
128 help: try moving the temporary above the match
129    |
130 LL ~     let value = 1 < mutex.lock().unwrap().s.len();
131 LL ~     match value {
132    |
133
134 error: temporary with significant drop in match scrutinee
135   --> $DIR/significant_drop_in_scrutinee.rs:308:11
136    |
137 LL |     match mutex1.lock().unwrap().s.len() < mutex2.lock().unwrap().s.len() {
138    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
139    |
140 help: try moving the temporary above the match
141    |
142 LL ~     let value = mutex1.lock().unwrap().s.len() < mutex2.lock().unwrap().s.len();
143 LL ~     match value {
144    |
145
146 error: temporary with significant drop in match scrutinee
147   --> $DIR/significant_drop_in_scrutinee.rs:319:11
148    |
149 LL |     match mutex1.lock().unwrap().s.len() >= mutex2.lock().unwrap().s.len() {
150    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
151    |
152 help: try moving the temporary above the match
153    |
154 LL ~     let value = mutex1.lock().unwrap().s.len() >= mutex2.lock().unwrap().s.len();
155 LL ~     match value {
156    |
157
158 error: temporary with significant drop in match scrutinee
159   --> $DIR/significant_drop_in_scrutinee.rs:354:11
160    |
161 LL |     match get_mutex_guard().s.len() > 1 {
162    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
163    |
164 help: try moving the temporary above the match
165    |
166 LL ~     let value = get_mutex_guard().s.len() > 1;
167 LL ~     match value {
168    |
169
170 error: temporary with significant drop in match scrutinee
171   --> $DIR/significant_drop_in_scrutinee.rs:371:11
172    |
173 LL |       match match i {
174    |  ___________^
175 LL | |         100 => mutex1.lock().unwrap(),
176 LL | |         _ => mutex2.lock().unwrap(),
177 LL | |     }
178 LL | |     .s
179 LL | |     .len()
180 LL | |         > 1
181    | |___________^
182    |
183 help: try moving the temporary above the match
184    |
185 LL ~     let value = match i {
186 LL +         100 => mutex1.lock().unwrap(),
187 LL +         _ => mutex2.lock().unwrap(),
188 LL +     }
189 LL +     .s
190 LL +     .len()
191  ...
192
193 error: temporary with significant drop in match scrutinee
194   --> $DIR/significant_drop_in_scrutinee.rs:397:11
195    |
196 LL |       match if i > 1 {
197    |  ___________^
198 LL | |         mutex1.lock().unwrap()
199 LL | |     } else {
200 LL | |         mutex2.lock().unwrap()
201 ...  |
202 LL | |     .len()
203 LL | |         > 1
204    | |___________^
205    |
206 help: try moving the temporary above the match
207    |
208 LL ~     let value = if i > 1 {
209 LL +         mutex1.lock().unwrap()
210 LL +     } else {
211 LL +         mutex2.lock().unwrap()
212 LL +     }
213 LL +     .s
214  ...
215
216 error: temporary with significant drop in match scrutinee
217   --> $DIR/significant_drop_in_scrutinee.rs:451:11
218    |
219 LL |     match s.lock().deref().deref() {
220    |           ^^^^^^^^^^^^^^^^^^^^^^^^
221    |
222 help: try moving the temporary above the match and create a copy
223    |
224 LL ~     let value = *s.lock().deref().deref();
225 LL ~     match value {
226    |
227
228 error: temporary with significant drop in match scrutinee
229   --> $DIR/significant_drop_in_scrutinee.rs:479:11
230    |
231 LL |     match s.lock().deref().deref() {
232    |           ^^^^^^^^^^^^^^^^^^^^^^^^
233
234 error: temporary with significant drop in match scrutinee
235   --> $DIR/significant_drop_in_scrutinee.rs:498:11
236    |
237 LL |     match mutex.lock().unwrap().i = i {
238    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
239    |
240 help: try moving the temporary above the match
241    |
242 LL ~     mutex.lock().unwrap().i = i;
243 LL ~     match () {
244    |
245
246 error: temporary with significant drop in match scrutinee
247   --> $DIR/significant_drop_in_scrutinee.rs:504:11
248    |
249 LL |     match i = mutex.lock().unwrap().i {
250    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
251    |
252 help: try moving the temporary above the match
253    |
254 LL ~     i = mutex.lock().unwrap().i;
255 LL ~     match () {
256    |
257
258 error: temporary with significant drop in match scrutinee
259   --> $DIR/significant_drop_in_scrutinee.rs:510:11
260    |
261 LL |     match mutex.lock().unwrap().i += 1 {
262    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
263    |
264 help: try moving the temporary above the match
265    |
266 LL ~     mutex.lock().unwrap().i += 1;
267 LL ~     match () {
268    |
269
270 error: temporary with significant drop in match scrutinee
271   --> $DIR/significant_drop_in_scrutinee.rs:516:11
272    |
273 LL |     match i += mutex.lock().unwrap().i {
274    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
275    |
276 help: try moving the temporary above the match
277    |
278 LL ~     i += mutex.lock().unwrap().i;
279 LL ~     match () {
280    |
281
282 error: temporary with significant drop in match scrutinee
283   --> $DIR/significant_drop_in_scrutinee.rs:579:11
284    |
285 LL |     match rwlock.read().unwrap().to_number() {
286    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
287
288 error: temporary with significant drop in for loop
289   --> $DIR/significant_drop_in_scrutinee.rs:589:14
290    |
291 LL |     for s in rwlock.read().unwrap().iter() {
292    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
293
294 error: aborting due to 25 previous errors
295