]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/significant_drop_in_scrutinee.stderr
Rollup merge of #95534 - jyn514:std-mem-copy, r=joshtriplett
[rust.git] / src / tools / clippy / 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 LL +         > 1;
192 LL ~     match value
193    |
194
195 error: temporary with significant drop in match scrutinee
196   --> $DIR/significant_drop_in_scrutinee.rs:397:11
197    |
198 LL |       match if i > 1 {
199    |  ___________^
200 LL | |         mutex1.lock().unwrap()
201 LL | |     } else {
202 LL | |         mutex2.lock().unwrap()
203 ...  |
204 LL | |     .len()
205 LL | |         > 1
206    | |___________^
207    |
208 help: try moving the temporary above the match
209    |
210 LL ~     let value = if i > 1 {
211 LL +         mutex1.lock().unwrap()
212 LL +     } else {
213 LL +         mutex2.lock().unwrap()
214 LL +     }
215 LL +     .s
216 LL +     .len()
217 LL +         > 1;
218 LL ~     match value
219    |
220
221 error: temporary with significant drop in match scrutinee
222   --> $DIR/significant_drop_in_scrutinee.rs:451:11
223    |
224 LL |     match s.lock().deref().deref() {
225    |           ^^^^^^^^^^^^^^^^^^^^^^^^
226    |
227 help: try moving the temporary above the match and create a copy
228    |
229 LL ~     let value = *s.lock().deref().deref();
230 LL ~     match value {
231    |
232
233 error: temporary with significant drop in match scrutinee
234   --> $DIR/significant_drop_in_scrutinee.rs:479:11
235    |
236 LL |     match s.lock().deref().deref() {
237    |           ^^^^^^^^^^^^^^^^^^^^^^^^
238
239 error: temporary with significant drop in match scrutinee
240   --> $DIR/significant_drop_in_scrutinee.rs:498:11
241    |
242 LL |     match mutex.lock().unwrap().i = i {
243    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
244    |
245 help: try moving the temporary above the match
246    |
247 LL ~     mutex.lock().unwrap().i = i;
248 LL ~     match () {
249    |
250
251 error: temporary with significant drop in match scrutinee
252   --> $DIR/significant_drop_in_scrutinee.rs:504:11
253    |
254 LL |     match i = mutex.lock().unwrap().i {
255    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
256    |
257 help: try moving the temporary above the match
258    |
259 LL ~     i = mutex.lock().unwrap().i;
260 LL ~     match () {
261    |
262
263 error: temporary with significant drop in match scrutinee
264   --> $DIR/significant_drop_in_scrutinee.rs:510:11
265    |
266 LL |     match mutex.lock().unwrap().i += 1 {
267    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
268    |
269 help: try moving the temporary above the match
270    |
271 LL ~     mutex.lock().unwrap().i += 1;
272 LL ~     match () {
273    |
274
275 error: temporary with significant drop in match scrutinee
276   --> $DIR/significant_drop_in_scrutinee.rs:516:11
277    |
278 LL |     match i += mutex.lock().unwrap().i {
279    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
280    |
281 help: try moving the temporary above the match
282    |
283 LL ~     i += mutex.lock().unwrap().i;
284 LL ~     match () {
285    |
286
287 error: temporary with significant drop in match scrutinee
288   --> $DIR/significant_drop_in_scrutinee.rs:579:11
289    |
290 LL |     match rwlock.read().unwrap().to_number() {
291    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
292
293 error: temporary with significant drop in for loop
294   --> $DIR/significant_drop_in_scrutinee.rs:589:14
295    |
296 LL |     for s in rwlock.read().unwrap().iter() {
297    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
298
299 error: aborting due to 25 previous errors
300