]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/significant_drop_in_scrutinee.stderr
Rollup merge of #96941 - nannany:master, r=lcnr,JohnTitor
[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:57: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:130: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:151: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:199: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:222: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:231: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:241: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:241: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:252: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:263: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:282: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:289: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:305: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:312: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:343: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:360:11
172    |
173 LL |     match match i { 100 => mutex1.lock().unwrap(), _ => mutex2.lock().unwrap() }.s.len() > 1 {
174    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
175    |
176 help: try moving the temporary above the match
177    |
178 LL ~     let value = match i { 100 => mutex1.lock().unwrap(), _ => mutex2.lock().unwrap() }.s.len() > 1;
179 LL ~     match value {
180    |
181
182 error: temporary with significant drop in match scrutinee
183   --> $DIR/significant_drop_in_scrutinee.rs:379:11
184    |
185 LL |     match if i > 1 { mutex1.lock().unwrap() } else { mutex2.lock().unwrap() }.s.len() > 1 {
186    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
187    |
188 help: try moving the temporary above the match
189    |
190 LL ~     let value = if i > 1 { mutex1.lock().unwrap() } else { mutex2.lock().unwrap() }.s.len() > 1;
191 LL ~     match value {
192    |
193
194 error: temporary with significant drop in match scrutinee
195   --> $DIR/significant_drop_in_scrutinee.rs:421:11
196    |
197 LL |     match s.lock().deref().deref() {
198    |           ^^^^^^^^^^^^^^^^^^^^^^^^
199    |
200 help: try moving the temporary above the match and create a copy
201    |
202 LL ~     let value = *s.lock().deref().deref();
203 LL ~     match value {
204    |
205
206 error: temporary with significant drop in match scrutinee
207   --> $DIR/significant_drop_in_scrutinee.rs:447:11
208    |
209 LL |     match s.lock().deref().deref() {
210    |           ^^^^^^^^^^^^^^^^^^^^^^^^
211
212 error: temporary with significant drop in match scrutinee
213   --> $DIR/significant_drop_in_scrutinee.rs:467:11
214    |
215 LL |     match mutex.lock().unwrap().i = i {
216    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
217    |
218 help: try moving the temporary above the match
219    |
220 LL ~     mutex.lock().unwrap().i = i;
221 LL ~     match () {
222    |
223
224 error: temporary with significant drop in match scrutinee
225   --> $DIR/significant_drop_in_scrutinee.rs:473:11
226    |
227 LL |     match i = mutex.lock().unwrap().i {
228    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
229    |
230 help: try moving the temporary above the match
231    |
232 LL ~     i = mutex.lock().unwrap().i;
233 LL ~     match () {
234    |
235
236 error: temporary with significant drop in match scrutinee
237   --> $DIR/significant_drop_in_scrutinee.rs:479:11
238    |
239 LL |     match mutex.lock().unwrap().i += 1 {
240    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
241    |
242 help: try moving the temporary above the match
243    |
244 LL ~     mutex.lock().unwrap().i += 1;
245 LL ~     match () {
246    |
247
248 error: temporary with significant drop in match scrutinee
249   --> $DIR/significant_drop_in_scrutinee.rs:485:11
250    |
251 LL |     match i += mutex.lock().unwrap().i {
252    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
253    |
254 help: try moving the temporary above the match
255    |
256 LL ~     i += mutex.lock().unwrap().i;
257 LL ~     match () {
258    |
259
260 error: aborting due to 23 previous errors
261