1 error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
2 --> $DIR/significant_drop_in_scrutinee.rs:59:11
4 LL | match mutex.lock().unwrap().foo() {
5 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
7 LL | mutex.lock().unwrap().bar();
8 | --------------------- another value with significant `Drop` created here
11 | - temporary lives until here
13 = note: `-D clippy::significant-drop-in-scrutinee` implied by `-D warnings`
14 = note: this might lead to deadlocks or other unexpected behavior
15 help: try moving the temporary above the match
17 LL ~ let value = mutex.lock().unwrap().foo();
21 error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
22 --> $DIR/significant_drop_in_scrutinee.rs:145:11
24 LL | match s.lock_m().get_the_value() {
25 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
27 LL | println!("{}", s.lock_m().get_the_value());
28 | ---------- another value with significant `Drop` created here
31 | - temporary lives until here
33 = note: this might lead to deadlocks or other unexpected behavior
34 help: try moving the temporary above the match
36 LL ~ let value = s.lock_m().get_the_value();
40 error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
41 --> $DIR/significant_drop_in_scrutinee.rs:166:11
43 LL | match s.lock_m_m().get_the_value() {
44 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
46 LL | println!("{}", s.lock_m().get_the_value());
47 | ---------- another value with significant `Drop` created here
50 | - temporary lives until here
52 = note: this might lead to deadlocks or other unexpected behavior
53 help: try moving the temporary above the match
55 LL ~ let value = s.lock_m_m().get_the_value();
59 error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
60 --> $DIR/significant_drop_in_scrutinee.rs:214:11
62 LL | match counter.temp_increment().len() {
63 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66 | - temporary lives until here
68 = note: this might lead to deadlocks or other unexpected behavior
69 help: try moving the temporary above the match
71 LL ~ let value = counter.temp_increment().len();
75 error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
76 --> $DIR/significant_drop_in_scrutinee.rs:237:16
78 LL | match (mutex1.lock().unwrap().s.len(), true) {
79 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
81 LL | mutex1.lock().unwrap().s.len();
82 | ---------------------- another value with significant `Drop` created here
85 | - temporary lives until here
87 = note: this might lead to deadlocks or other unexpected behavior
88 help: try moving the temporary above the match
90 LL ~ let value = mutex1.lock().unwrap().s.len();
91 LL ~ match (value, true) {
94 error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
95 --> $DIR/significant_drop_in_scrutinee.rs:246:22
97 LL | match (true, mutex1.lock().unwrap().s.len(), true) {
98 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
100 LL | mutex1.lock().unwrap().s.len();
101 | ---------------------- another value with significant `Drop` created here
104 | - temporary lives until here
106 = note: this might lead to deadlocks or other unexpected behavior
107 help: try moving the temporary above the match
109 LL ~ let value = mutex1.lock().unwrap().s.len();
110 LL ~ match (true, value, true) {
113 error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
114 --> $DIR/significant_drop_in_scrutinee.rs:256:16
116 LL | match (mutex1.lock().unwrap().s.len(), true, mutex2.lock().unwrap().s.len()) {
117 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
119 LL | mutex1.lock().unwrap().s.len();
120 | ---------------------- another value with significant `Drop` created here
121 LL | mutex2.lock().unwrap().s.len();
122 | ---------------------- another value with significant `Drop` created here
125 | - temporary lives until here
127 = note: this might lead to deadlocks or other unexpected behavior
128 help: try moving the temporary above the match
130 LL ~ let value = mutex1.lock().unwrap().s.len();
131 LL ~ match (value, true, mutex2.lock().unwrap().s.len()) {
134 error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
135 --> $DIR/significant_drop_in_scrutinee.rs:256:54
137 LL | match (mutex1.lock().unwrap().s.len(), true, mutex2.lock().unwrap().s.len()) {
138 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
140 LL | mutex1.lock().unwrap().s.len();
141 | ---------------------- another value with significant `Drop` created here
142 LL | mutex2.lock().unwrap().s.len();
143 | ---------------------- another value with significant `Drop` created here
146 | - temporary lives until here
148 = note: this might lead to deadlocks or other unexpected behavior
149 help: try moving the temporary above the match
151 LL ~ let value = mutex2.lock().unwrap().s.len();
152 LL ~ match (mutex1.lock().unwrap().s.len(), true, value) {
155 error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
156 --> $DIR/significant_drop_in_scrutinee.rs:267:15
158 LL | match mutex3.lock().unwrap().s.as_str() {
159 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
161 LL | mutex1.lock().unwrap().s.len();
162 | ---------------------- another value with significant `Drop` created here
163 LL | mutex2.lock().unwrap().s.len();
164 | ---------------------- another value with significant `Drop` created here
167 | - temporary lives until here
169 = note: this might lead to deadlocks or other unexpected behavior
171 error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
172 --> $DIR/significant_drop_in_scrutinee.rs:277:22
174 LL | match (true, mutex3.lock().unwrap().s.as_str()) {
175 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
177 LL | mutex1.lock().unwrap().s.len();
178 | ---------------------- another value with significant `Drop` created here
179 LL | mutex2.lock().unwrap().s.len();
180 | ---------------------- another value with significant `Drop` created here
183 | - temporary lives until here
185 = note: this might lead to deadlocks or other unexpected behavior
187 error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
188 --> $DIR/significant_drop_in_scrutinee.rs:296:11
190 LL | match mutex.lock().unwrap().s.len() > 1 {
191 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
193 LL | mutex.lock().unwrap().s.len();
194 | --------------------- another value with significant `Drop` created here
197 | - temporary lives until here
199 = note: this might lead to deadlocks or other unexpected behavior
200 help: try moving the temporary above the match
202 LL ~ let value = mutex.lock().unwrap().s.len() > 1;
206 error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
207 --> $DIR/significant_drop_in_scrutinee.rs:303:11
209 LL | match 1 < mutex.lock().unwrap().s.len() {
210 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
212 LL | mutex.lock().unwrap().s.len();
213 | --------------------- another value with significant `Drop` created here
216 | - temporary lives until here
218 = note: this might lead to deadlocks or other unexpected behavior
219 help: try moving the temporary above the match
221 LL ~ let value = 1 < mutex.lock().unwrap().s.len();
225 error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
226 --> $DIR/significant_drop_in_scrutinee.rs:321:11
228 LL | match mutex1.lock().unwrap().s.len() < mutex2.lock().unwrap().s.len() {
229 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
231 LL | mutex1.lock().unwrap().s.len(),
232 | ---------------------- another value with significant `Drop` created here
233 LL | mutex2.lock().unwrap().s.len()
234 | ---------------------- another value with significant `Drop` created here
237 | - temporary lives until here
239 = note: this might lead to deadlocks or other unexpected behavior
240 help: try moving the temporary above the match
242 LL ~ let value = mutex1.lock().unwrap().s.len() < mutex2.lock().unwrap().s.len();
246 error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
247 --> $DIR/significant_drop_in_scrutinee.rs:332:11
249 LL | match mutex1.lock().unwrap().s.len() >= mutex2.lock().unwrap().s.len() {
250 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
252 LL | mutex1.lock().unwrap().s.len(),
253 | ---------------------- another value with significant `Drop` created here
254 LL | mutex2.lock().unwrap().s.len()
255 | ---------------------- another value with significant `Drop` created here
258 | - temporary lives until here
260 = note: this might lead to deadlocks or other unexpected behavior
261 help: try moving the temporary above the match
263 LL ~ let value = mutex1.lock().unwrap().s.len() >= mutex2.lock().unwrap().s.len();
267 error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
268 --> $DIR/significant_drop_in_scrutinee.rs:367:11
270 LL | match get_mutex_guard().s.len() > 1 {
271 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
273 LL | mutex1.lock().unwrap().s.len();
274 | ---------------------- another value with significant `Drop` created here
277 | - temporary lives until here
279 = note: this might lead to deadlocks or other unexpected behavior
280 help: try moving the temporary above the match
282 LL ~ let value = get_mutex_guard().s.len() > 1;
286 error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
287 --> $DIR/significant_drop_in_scrutinee.rs:384:11
291 LL | | 100 => mutex1.lock().unwrap(),
292 LL | | _ => mutex2.lock().unwrap(),
299 LL | mutex1.lock().unwrap().s.len();
300 | ---------------------- another value with significant `Drop` created here
303 | - temporary lives until here
305 = note: this might lead to deadlocks or other unexpected behavior
306 help: try moving the temporary above the match
308 LL ~ let value = match i {
309 LL + 100 => mutex1.lock().unwrap(),
310 LL + _ => mutex2.lock().unwrap(),
318 error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
319 --> $DIR/significant_drop_in_scrutinee.rs:410:11
321 LL | match if i > 1 {
323 LL | | mutex1.lock().unwrap()
325 LL | | mutex2.lock().unwrap()
331 LL | mutex1.lock().unwrap().s.len();
332 | ---------------------- another value with significant `Drop` created here
335 | - temporary lives until here
337 = note: this might lead to deadlocks or other unexpected behavior
338 help: try moving the temporary above the match
340 LL ~ let value = if i > 1 {
341 LL + mutex1.lock().unwrap()
343 LL + mutex2.lock().unwrap()
351 error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
352 --> $DIR/significant_drop_in_scrutinee.rs:464:11
354 LL | match s.lock().deref().deref() {
355 | ^^^^^^^^^^^^^^^^^^^^^^^^
356 LL | 0 | 1 => println!("Value was less than 2"),
357 LL | _ => println!("Value is {}", s.lock().deref()),
358 | ---------------- another value with significant `Drop` created here
360 | - temporary lives until here
362 = note: this might lead to deadlocks or other unexpected behavior
363 help: try moving the temporary above the match and create a copy
365 LL ~ let value = *s.lock().deref().deref();
369 error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
370 --> $DIR/significant_drop_in_scrutinee.rs:492:11
372 LL | match s.lock().deref().deref() {
373 | ^^^^^^^^^^^^^^^^^^^^^^^^
374 LL | matcher => println!("Value is {}", s.lock().deref()),
375 | ---------------- another value with significant `Drop` created here
376 LL | _ => println!("Value was not a match"),
378 | - temporary lives until here
380 = note: this might lead to deadlocks or other unexpected behavior
382 error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
383 --> $DIR/significant_drop_in_scrutinee.rs:511:11
385 LL | match mutex.lock().unwrap().i = i {
386 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
388 LL | println!("{}", mutex.lock().unwrap().i);
389 | --------------------- another value with significant `Drop` created here
392 | - temporary lives until here
394 = note: this might lead to deadlocks or other unexpected behavior
395 help: try moving the temporary above the match
397 LL ~ mutex.lock().unwrap().i = i;
401 error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
402 --> $DIR/significant_drop_in_scrutinee.rs:517:11
404 LL | match i = mutex.lock().unwrap().i {
405 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
407 LL | println!("{}", mutex.lock().unwrap().i);
408 | --------------------- another value with significant `Drop` created here
411 | - temporary lives until here
413 = note: this might lead to deadlocks or other unexpected behavior
414 help: try moving the temporary above the match
416 LL ~ i = mutex.lock().unwrap().i;
420 error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
421 --> $DIR/significant_drop_in_scrutinee.rs:523:11
423 LL | match mutex.lock().unwrap().i += 1 {
424 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
426 LL | println!("{}", mutex.lock().unwrap().i);
427 | --------------------- another value with significant `Drop` created here
430 | - temporary lives until here
432 = note: this might lead to deadlocks or other unexpected behavior
433 help: try moving the temporary above the match
435 LL ~ mutex.lock().unwrap().i += 1;
439 error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
440 --> $DIR/significant_drop_in_scrutinee.rs:529:11
442 LL | match i += mutex.lock().unwrap().i {
443 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
445 LL | println!("{}", mutex.lock().unwrap().i);
446 | --------------------- another value with significant `Drop` created here
449 | - temporary lives until here
451 = note: this might lead to deadlocks or other unexpected behavior
452 help: try moving the temporary above the match
454 LL ~ i += mutex.lock().unwrap().i;
458 error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
459 --> $DIR/significant_drop_in_scrutinee.rs:592:11
461 LL | match rwlock.read().unwrap().to_number() {
462 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
465 | - temporary lives until here
467 = note: this might lead to deadlocks or other unexpected behavior
469 error: temporary with significant `Drop` in `for` loop condition will live until the end of the `for` expression
470 --> $DIR/significant_drop_in_scrutinee.rs:602:14
472 LL | for s in rwlock.read().unwrap().iter() {
473 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
474 LL | println!("{}", s);
476 | - temporary lives until here
478 = note: this might lead to deadlocks or other unexpected behavior
480 error: temporary with significant `Drop` in `match` scrutinee will live until the end of the `match` expression
481 --> $DIR/significant_drop_in_scrutinee.rs:617:11
483 LL | match mutex.lock().unwrap().foo() {
484 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
487 | - temporary lives until here
489 = note: this might lead to deadlocks or other unexpected behavior
490 help: try moving the temporary above the match
492 LL ~ let value = mutex.lock().unwrap().foo();
496 error: aborting due to 26 previous errors