]> git.lizzy.rs Git - rust.git/blob - tests/ui/copies.stderr
Auto merge of #3635 - matthiaskrgr:revert_random_state_3603, r=xfix
[rust.git] / tests / ui / copies.stderr
1 error: this `if` has identical blocks
2   --> $DIR/copies.rs:50:12
3    |
4 LL |       } else {
5    |  ____________^
6 LL | |         //~ ERROR same body as `if` block
7 LL | |         Foo { bar: 42 };
8 LL | |         0..10;
9 ...  |
10 LL | |         foo();
11 LL | |     }
12    | |_____^
13    |
14    = note: `-D clippy::if-same-then-else` implied by `-D warnings`
15 note: same as this
16   --> $DIR/copies.rs:42:13
17    |
18 LL |       if true {
19    |  _____________^
20 LL | |         Foo { bar: 42 };
21 LL | |         0..10;
22 LL | |         ..;
23 ...  |
24 LL | |         foo();
25 LL | |     } else {
26    | |_____^
27
28 error: this `match` has identical arm bodies
29   --> $DIR/copies.rs:96:14
30    |
31 LL |           _ => {
32    |  ______________^
33 LL | |             //~ ERROR match arms have same body
34 LL | |             foo();
35 LL | |             let mut a = 42 + [23].len() as i32;
36 ...  |
37 LL | |             a
38 LL | |         },
39    | |_________^
40    |
41    = note: `-D clippy::match-same-arms` implied by `-D warnings`
42 note: same as this
43   --> $DIR/copies.rs:87:15
44    |
45 LL |           42 => {
46    |  _______________^
47 LL | |             foo();
48 LL | |             let mut a = 42 + [23].len() as i32;
49 LL | |             if true {
50 ...  |
51 LL | |             a
52 LL | |         },
53    | |_________^
54 note: `42` has the same arm body as the `_` wildcard, consider removing it`
55   --> $DIR/copies.rs:87:15
56    |
57 LL |           42 => {
58    |  _______________^
59 LL | |             foo();
60 LL | |             let mut a = 42 + [23].len() as i32;
61 LL | |             if true {
62 ...  |
63 LL | |             a
64 LL | |         },
65    | |_________^
66
67 error: this `match` has identical arm bodies
68   --> $DIR/copies.rs:111:14
69    |
70 LL |         _ => 0, //~ ERROR match arms have same body
71    |              ^
72    |
73 note: same as this
74   --> $DIR/copies.rs:109:19
75    |
76 LL |         Abc::A => 0,
77    |                   ^
78 note: `Abc::A` has the same arm body as the `_` wildcard, consider removing it`
79   --> $DIR/copies.rs:109:19
80    |
81 LL |         Abc::A => 0,
82    |                   ^
83
84 error: this `if` has identical blocks
85   --> $DIR/copies.rs:120:12
86    |
87 LL |       } else {
88    |  ____________^
89 LL | |         //~ ERROR same body as `if` block
90 LL | |         42
91 LL | |     };
92    | |_____^
93    |
94 note: same as this
95   --> $DIR/copies.rs:118:21
96    |
97 LL |       let _ = if true {
98    |  _____________________^
99 LL | |         42
100 LL | |     } else {
101    | |_____^
102
103 error: this `if` has identical blocks
104   --> $DIR/copies.rs:134:12
105    |
106 LL |       } else {
107    |  ____________^
108 LL | |         //~ ERROR same body as `if` block
109 LL | |         for _ in &[42] {
110 LL | |             let foo: &Option<_> = &Some::<u8>(42);
111 ...  |
112 LL | |         }
113 LL | |     }
114    | |_____^
115    |
116 note: same as this
117   --> $DIR/copies.rs:125:13
118    |
119 LL |       if true {
120    |  _____________^
121 LL | |         for _ in &[42] {
122 LL | |             let foo: &Option<_> = &Some::<u8>(42);
123 LL | |             if true {
124 ...  |
125 LL | |         }
126 LL | |     } else {
127    | |_____^
128
129 error: this `if` has identical blocks
130   --> $DIR/copies.rs:153:12
131    |
132 LL |       } else {
133    |  ____________^
134 LL | |         //~ ERROR same body as `if` block
135 LL | |         let bar = if true { 42 } else { 43 };
136 LL | |
137 ...  |
138 LL | |         bar + 1;
139 LL | |     }
140    | |_____^
141    |
142 note: same as this
143   --> $DIR/copies.rs:146:13
144    |
145 LL |       if true {
146    |  _____________^
147 LL | |         let bar = if true { 42 } else { 43 };
148 LL | |
149 LL | |         while foo() {
150 ...  |
151 LL | |         bar + 1;
152 LL | |     } else {
153    | |_____^
154
155 error: this `if` has identical blocks
156   --> $DIR/copies.rs:183:12
157    |
158 LL |       } else {
159    |  ____________^
160 LL | |         //~ ERROR same body as `if` block
161 LL | |         if let Some(a) = Some(42) {}
162 LL | |     }
163    | |_____^
164    |
165 note: same as this
166   --> $DIR/copies.rs:181:13
167    |
168 LL |       if true {
169    |  _____________^
170 LL | |         if let Some(a) = Some(42) {}
171 LL | |     } else {
172    | |_____^
173
174 error: this `if` has identical blocks
175   --> $DIR/copies.rs:190:12
176    |
177 LL |       } else {
178    |  ____________^
179 LL | |         //~ ERROR same body as `if` block
180 LL | |         if let (1, .., 3) = (1, 2, 3) {}
181 LL | |     }
182    | |_____^
183    |
184 note: same as this
185   --> $DIR/copies.rs:188:13
186    |
187 LL |       if true {
188    |  _____________^
189 LL | |         if let (1, .., 3) = (1, 2, 3) {}
190 LL | |     } else {
191    | |_____^
192
193 error: this `match` has identical arm bodies
194   --> $DIR/copies.rs:239:15
195    |
196 LL |         51 => foo(), //~ ERROR match arms have same body
197    |               ^^^^^
198    |
199 note: same as this
200   --> $DIR/copies.rs:238:15
201    |
202 LL |         42 => foo(),
203    |               ^^^^^
204 note: consider refactoring into `42 | 51`
205   --> $DIR/copies.rs:238:15
206    |
207 LL |         42 => foo(),
208    |               ^^^^^
209
210 error: this `match` has identical arm bodies
211   --> $DIR/copies.rs:245:17
212    |
213 LL |         None => 24, //~ ERROR match arms have same body
214    |                 ^^
215    |
216 note: same as this
217   --> $DIR/copies.rs:244:20
218    |
219 LL |         Some(_) => 24,
220    |                    ^^
221 note: consider refactoring into `Some(_) | None`
222   --> $DIR/copies.rs:244:20
223    |
224 LL |         Some(_) => 24,
225    |                    ^^
226
227 error: this `match` has identical arm bodies
228   --> $DIR/copies.rs:267:28
229    |
230 LL |         (None, Some(a)) => bar(a), //~ ERROR match arms have same body
231    |                            ^^^^^^
232    |
233 note: same as this
234   --> $DIR/copies.rs:266:28
235    |
236 LL |         (Some(a), None) => bar(a),
237    |                            ^^^^^^
238 note: consider refactoring into `(Some(a), None) | (None, Some(a))`
239   --> $DIR/copies.rs:266:28
240    |
241 LL |         (Some(a), None) => bar(a),
242    |                            ^^^^^^
243
244 error: this `match` has identical arm bodies
245   --> $DIR/copies.rs:273:26
246    |
247 LL |         (.., Some(a)) => bar(a), //~ ERROR match arms have same body
248    |                          ^^^^^^
249    |
250 note: same as this
251   --> $DIR/copies.rs:272:26
252    |
253 LL |         (Some(a), ..) => bar(a),
254    |                          ^^^^^^
255 note: consider refactoring into `(Some(a), ..) | (.., Some(a))`
256   --> $DIR/copies.rs:272:26
257    |
258 LL |         (Some(a), ..) => bar(a),
259    |                          ^^^^^^
260
261 error: this `match` has identical arm bodies
262   --> $DIR/copies.rs:279:20
263    |
264 LL |         (.., 3) => 42, //~ ERROR match arms have same body
265    |                    ^^
266    |
267 note: same as this
268   --> $DIR/copies.rs:278:23
269    |
270 LL |         (1, .., 3) => 42,
271    |                       ^^
272 note: consider refactoring into `(1, .., 3) | (.., 3)`
273   --> $DIR/copies.rs:278:23
274    |
275 LL |         (1, .., 3) => 42,
276    |                       ^^
277
278 error: this `if` has identical blocks
279   --> $DIR/copies.rs:285:12
280    |
281 LL |       } else {
282    |  ____________^
283 LL | |         //~ ERROR same body as `if` block
284 LL | |         0.0
285 LL | |     };
286    | |_____^
287    |
288 note: same as this
289   --> $DIR/copies.rs:283:21
290    |
291 LL |       let _ = if true {
292    |  _____________________^
293 LL | |         0.0
294 LL | |     } else {
295    | |_____^
296
297 error: this `if` has identical blocks
298   --> $DIR/copies.rs:292:12
299    |
300 LL |       } else {
301    |  ____________^
302 LL | |         //~ ERROR same body as `if` block
303 LL | |         -0.0
304 LL | |     };
305    | |_____^
306    |
307 note: same as this
308   --> $DIR/copies.rs:290:21
309    |
310 LL |       let _ = if true {
311    |  _____________________^
312 LL | |         -0.0
313 LL | |     } else {
314    | |_____^
315
316 error: this `if` has identical blocks
317   --> $DIR/copies.rs:305:12
318    |
319 LL |       } else {
320    |  ____________^
321 LL | |         //~ ERROR same body as `if` block
322 LL | |         std::f32::NAN
323 LL | |     };
324    | |_____^
325    |
326 note: same as this
327   --> $DIR/copies.rs:303:21
328    |
329 LL |       let _ = if true {
330    |  _____________________^
331 LL | |         std::f32::NAN
332 LL | |     } else {
333    | |_____^
334
335 error: this `if` has identical blocks
336   --> $DIR/copies.rs:323:12
337    |
338 LL |       } else {
339    |  ____________^
340 LL | |         //~ ERROR same body as `if` block
341 LL | |         try!(Ok("foo"));
342 LL | |     }
343    | |_____^
344    |
345 note: same as this
346   --> $DIR/copies.rs:321:13
347    |
348 LL |       if true {
349    |  _____________^
350 LL | |         try!(Ok("foo"));
351 LL | |     } else {
352    | |_____^
353
354 error: aborting due to 17 previous errors
355