2017-02-07 14:05:30 -06:00
|
|
|
error: this `if` has identical blocks
|
|
|
|
--> $DIR/copies.rs:40:10
|
|
|
|
|
|
2017-02-08 07:58:07 -06:00
|
|
|
40 | else {
|
2017-02-07 14:05:30 -06:00
|
|
|
| __________^ starting here...
|
|
|
|
41 | | Foo { bar: 42 };
|
|
|
|
42 | | 0..10;
|
|
|
|
43 | | ..;
|
2017-04-10 08:36:07 -05:00
|
|
|
... |
|
2017-02-07 14:05:30 -06:00
|
|
|
47 | | foo();
|
|
|
|
48 | | }
|
|
|
|
| |_____^ ...ending here
|
|
|
|
|
|
|
|
|
note: lint level defined here
|
|
|
|
--> $DIR/copies.rs:27:8
|
|
|
|
|
|
|
|
|
27 | #[deny(if_same_then_else)]
|
|
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
note: same as this
|
|
|
|
--> $DIR/copies.rs:30:13
|
|
|
|
|
|
2017-04-10 08:36:07 -05:00
|
|
|
30 | if true {
|
|
|
|
| _____________^ starting here...
|
|
|
|
31 | |
|
|
|
|
32 | | Foo { bar: 42 };
|
|
|
|
33 | | 0..10;
|
|
|
|
... |
|
|
|
|
38 | | foo();
|
|
|
|
39 | | }
|
|
|
|
| |_____^ ...ending here
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
error: this `match` has identical arm bodies
|
|
|
|
--> $DIR/copies.rs:91:14
|
|
|
|
|
|
2017-02-08 07:58:07 -06:00
|
|
|
91 | _ => {
|
2017-02-07 14:05:30 -06:00
|
|
|
| ______________^ starting here...
|
|
|
|
92 | | foo();
|
|
|
|
93 | | let mut a = 42 + [23].len() as i32;
|
|
|
|
94 | | if true {
|
2017-04-10 08:36:07 -05:00
|
|
|
... |
|
2017-02-07 14:05:30 -06:00
|
|
|
98 | | a
|
|
|
|
99 | | }
|
|
|
|
| |_________^ ...ending here
|
|
|
|
|
|
|
|
|
note: lint level defined here
|
|
|
|
--> $DIR/copies.rs:28:8
|
|
|
|
|
|
|
|
|
28 | #[deny(match_same_arms)]
|
|
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
note: same as this
|
|
|
|
--> $DIR/copies.rs:80:15
|
|
|
|
|
|
2017-04-10 08:36:07 -05:00
|
|
|
80 | 42 => {
|
|
|
|
| _______________^ starting here...
|
|
|
|
81 | |
|
|
|
|
82 | |
|
|
|
|
83 | | foo();
|
|
|
|
... |
|
|
|
|
89 | | a
|
|
|
|
90 | | }
|
|
|
|
| |_________^ ...ending here
|
2017-02-07 14:05:30 -06:00
|
|
|
note: `42` has the same arm body as the `_` wildcard, consider removing it`
|
|
|
|
--> $DIR/copies.rs:80:15
|
|
|
|
|
|
2017-04-10 08:36:07 -05:00
|
|
|
80 | 42 => {
|
|
|
|
| _______________^ starting here...
|
|
|
|
81 | |
|
|
|
|
82 | |
|
|
|
|
83 | | foo();
|
|
|
|
... |
|
|
|
|
89 | | a
|
|
|
|
90 | | }
|
|
|
|
| |_________^ ...ending here
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
error: this `match` has identical arm bodies
|
|
|
|
--> $DIR/copies.rs:107:14
|
|
|
|
|
|
2017-02-08 07:58:07 -06:00
|
|
|
107 | _ => 0,
|
2017-02-07 14:05:30 -06:00
|
|
|
| ^
|
|
|
|
|
|
|
|
|
note: same as this
|
|
|
|
--> $DIR/copies.rs:103:19
|
|
|
|
|
|
|
|
|
103 | Abc::A => 0,
|
|
|
|
| ^
|
|
|
|
note: `Abc::A` has the same arm body as the `_` wildcard, consider removing it`
|
|
|
|
--> $DIR/copies.rs:103:19
|
|
|
|
|
|
|
|
|
103 | Abc::A => 0,
|
|
|
|
| ^
|
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
|
|
|
--> $DIR/copies.rs:118:10
|
|
|
|
|
|
2017-02-08 07:58:07 -06:00
|
|
|
118 | else {
|
2017-02-07 14:05:30 -06:00
|
|
|
| __________^ starting here...
|
|
|
|
119 | | 42
|
|
|
|
120 | | };
|
|
|
|
| |_____^ ...ending here
|
|
|
|
|
|
|
|
|
note: same as this
|
|
|
|
--> $DIR/copies.rs:114:21
|
|
|
|
|
|
|
|
|
114 | let _ = if true {
|
|
|
|
| _____________________^ starting here...
|
2017-02-08 07:58:07 -06:00
|
|
|
115 | |
|
2017-02-07 14:05:30 -06:00
|
|
|
116 | | 42
|
|
|
|
117 | | }
|
|
|
|
| |_____^ ...ending here
|
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
|
|
|
--> $DIR/copies.rs:133:10
|
|
|
|
|
|
2017-04-10 08:36:07 -05:00
|
|
|
133 | else {
|
|
|
|
| __________^ starting here...
|
|
|
|
134 | | for _ in &[42] {
|
|
|
|
135 | | let foo: &Option<_> = &Some::<u8>(42);
|
|
|
|
136 | | if true {
|
|
|
|
... |
|
|
|
|
141 | | }
|
|
|
|
142 | | }
|
|
|
|
| |_____^ ...ending here
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
|
note: same as this
|
|
|
|
--> $DIR/copies.rs:122:13
|
|
|
|
|
|
2017-04-10 08:36:07 -05:00
|
|
|
122 | if true {
|
|
|
|
| _____________^ starting here...
|
|
|
|
123 | |
|
|
|
|
124 | | for _ in &[42] {
|
|
|
|
125 | | let foo: &Option<_> = &Some::<u8>(42);
|
|
|
|
... |
|
|
|
|
131 | | }
|
|
|
|
132 | | }
|
|
|
|
| |_____^ ...ending here
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
|
|
|
--> $DIR/copies.rs:156:10
|
|
|
|
|
|
2017-04-10 08:36:07 -05:00
|
|
|
156 | else {
|
|
|
|
| __________^ starting here...
|
|
|
|
157 | | let bar = if true {
|
|
|
|
158 | | 42
|
|
|
|
159 | | }
|
|
|
|
... |
|
|
|
|
165 | | bar + 1;
|
|
|
|
166 | | }
|
|
|
|
| |_____^ ...ending here
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
|
note: same as this
|
|
|
|
--> $DIR/copies.rs:144:13
|
|
|
|
|
|
2017-04-10 08:36:07 -05:00
|
|
|
144 | if true {
|
|
|
|
| _____________^ starting here...
|
|
|
|
145 | |
|
|
|
|
146 | | let bar = if true {
|
|
|
|
147 | | 42
|
|
|
|
... |
|
|
|
|
154 | | bar + 1;
|
|
|
|
155 | | }
|
|
|
|
| |_____^ ...ending here
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
|
|
|
--> $DIR/copies.rs:180:19
|
|
|
|
|
|
2017-02-08 07:58:07 -06:00
|
|
|
180 | else if foo() {
|
2017-02-07 14:05:30 -06:00
|
|
|
| ___________________^ starting here...
|
|
|
|
181 | | let _ = match 42 {
|
|
|
|
182 | | 42 => 1,
|
|
|
|
183 | | a if a > 0 => 2,
|
2017-04-10 08:36:07 -05:00
|
|
|
... |
|
2017-02-07 14:05:30 -06:00
|
|
|
186 | | };
|
|
|
|
187 | | }
|
|
|
|
| |_____^ ...ending here
|
|
|
|
|
|
|
|
|
note: same as this
|
|
|
|
--> $DIR/copies.rs:168:13
|
|
|
|
|
|
|
|
|
168 | if true {
|
|
|
|
| _____________^ starting here...
|
2017-02-08 07:58:07 -06:00
|
|
|
169 | |
|
2017-02-07 14:05:30 -06:00
|
|
|
170 | | let _ = match 42 {
|
|
|
|
171 | | 42 => 1,
|
2017-04-10 08:36:07 -05:00
|
|
|
... |
|
2017-02-07 14:05:30 -06:00
|
|
|
175 | | };
|
|
|
|
176 | | }
|
|
|
|
| |_____^ ...ending here
|
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
|
|
|
--> $DIR/copies.rs:193:10
|
|
|
|
|
|
2017-02-08 07:58:07 -06:00
|
|
|
193 | else {
|
2017-02-07 14:05:30 -06:00
|
|
|
| __________^ starting here...
|
|
|
|
194 | | if let Some(a) = Some(42) {}
|
|
|
|
195 | | }
|
|
|
|
| |_____^ ...ending here
|
|
|
|
|
|
|
|
|
note: same as this
|
|
|
|
--> $DIR/copies.rs:189:13
|
|
|
|
|
|
|
|
|
189 | if true {
|
|
|
|
| _____________^ starting here...
|
2017-02-08 07:58:07 -06:00
|
|
|
190 | |
|
2017-02-07 14:05:30 -06:00
|
|
|
191 | | if let Some(a) = Some(42) {}
|
|
|
|
192 | | }
|
|
|
|
| |_____^ ...ending here
|
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
|
|
|
--> $DIR/copies.rs:201:10
|
|
|
|
|
|
2017-02-08 07:58:07 -06:00
|
|
|
201 | else {
|
2017-02-07 14:05:30 -06:00
|
|
|
| __________^ starting here...
|
|
|
|
202 | | if let (1, .., 3) = (1, 2, 3) {}
|
|
|
|
203 | | }
|
|
|
|
| |_____^ ...ending here
|
|
|
|
|
|
|
|
|
note: same as this
|
|
|
|
--> $DIR/copies.rs:197:13
|
|
|
|
|
|
|
|
|
197 | if true {
|
|
|
|
| _____________^ starting here...
|
2017-02-08 07:58:07 -06:00
|
|
|
198 | |
|
2017-02-07 14:05:30 -06:00
|
|
|
199 | | if let (1, .., 3) = (1, 2, 3) {}
|
|
|
|
200 | | }
|
|
|
|
| |_____^ ...ending here
|
|
|
|
|
|
|
|
error: this `match` has identical arm bodies
|
|
|
|
--> $DIR/copies.rs:258:15
|
|
|
|
|
|
2017-02-08 07:58:07 -06:00
|
|
|
258 | 51 => foo(),
|
2017-02-07 14:05:30 -06:00
|
|
|
| ^^^^^
|
|
|
|
|
|
|
|
|
note: same as this
|
|
|
|
--> $DIR/copies.rs:255:15
|
|
|
|
|
|
|
|
|
255 | 42 => foo(),
|
|
|
|
| ^^^^^
|
|
|
|
note: consider refactoring into `42 | 51`
|
|
|
|
--> $DIR/copies.rs:255:15
|
|
|
|
|
|
|
|
|
255 | 42 => foo(),
|
|
|
|
| ^^^^^
|
|
|
|
|
|
|
|
error: this `match` has identical arm bodies
|
|
|
|
--> $DIR/copies.rs:266:17
|
|
|
|
|
|
2017-02-08 07:58:07 -06:00
|
|
|
266 | None => 24,
|
2017-02-07 14:05:30 -06:00
|
|
|
| ^^
|
|
|
|
|
|
|
|
|
note: same as this
|
|
|
|
--> $DIR/copies.rs:263:20
|
|
|
|
|
|
|
|
|
263 | Some(_) => 24,
|
|
|
|
| ^^
|
|
|
|
note: consider refactoring into `Some(_) | None`
|
|
|
|
--> $DIR/copies.rs:263:20
|
|
|
|
|
|
|
|
|
263 | Some(_) => 24,
|
|
|
|
| ^^
|
|
|
|
|
|
|
|
error: this `match` has identical arm bodies
|
|
|
|
--> $DIR/copies.rs:290:28
|
|
|
|
|
|
2017-02-08 07:58:07 -06:00
|
|
|
290 | (None, Some(a)) => bar(a),
|
2017-02-07 14:05:30 -06:00
|
|
|
| ^^^^^^
|
|
|
|
|
|
|
|
|
note: same as this
|
|
|
|
--> $DIR/copies.rs:287:28
|
|
|
|
|
|
|
|
|
287 | (Some(a), None) => bar(a),
|
|
|
|
| ^^^^^^
|
|
|
|
note: consider refactoring into `(Some(a), None) | (None, Some(a))`
|
|
|
|
--> $DIR/copies.rs:287:28
|
|
|
|
|
|
|
|
|
287 | (Some(a), None) => bar(a),
|
|
|
|
| ^^^^^^
|
|
|
|
|
|
|
|
error: this `match` has identical arm bodies
|
|
|
|
--> $DIR/copies.rs:298:26
|
|
|
|
|
|
2017-02-08 07:58:07 -06:00
|
|
|
298 | (.., Some(a)) => bar(a),
|
2017-02-07 14:05:30 -06:00
|
|
|
| ^^^^^^
|
|
|
|
|
|
|
|
|
note: same as this
|
|
|
|
--> $DIR/copies.rs:295:26
|
|
|
|
|
|
|
|
|
295 | (Some(a), ..) => bar(a),
|
|
|
|
| ^^^^^^
|
|
|
|
note: consider refactoring into `(Some(a), ..) | (.., Some(a))`
|
|
|
|
--> $DIR/copies.rs:295:26
|
|
|
|
|
|
|
|
|
295 | (Some(a), ..) => bar(a),
|
|
|
|
| ^^^^^^
|
|
|
|
|
|
|
|
error: this `match` has identical arm bodies
|
|
|
|
--> $DIR/copies.rs:306:20
|
|
|
|
|
|
2017-02-08 07:58:07 -06:00
|
|
|
306 | (.., 3) => 42,
|
2017-02-07 14:05:30 -06:00
|
|
|
| ^^
|
|
|
|
|
|
|
|
|
note: same as this
|
|
|
|
--> $DIR/copies.rs:303:23
|
|
|
|
|
|
|
|
|
303 | (1, .., 3) => 42,
|
|
|
|
| ^^
|
|
|
|
note: consider refactoring into `(1, .., 3) | (.., 3)`
|
|
|
|
--> $DIR/copies.rs:303:23
|
|
|
|
|
|
|
|
|
303 | (1, .., 3) => 42,
|
|
|
|
| ^^
|
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
|
|
|
--> $DIR/copies.rs:313:12
|
|
|
|
|
|
2017-02-08 07:58:07 -06:00
|
|
|
313 | } else {
|
2017-02-07 14:05:30 -06:00
|
|
|
| ____________^ starting here...
|
|
|
|
314 | | 0.0
|
|
|
|
315 | | };
|
|
|
|
| |_____^ ...ending here
|
|
|
|
|
|
|
|
|
note: same as this
|
|
|
|
--> $DIR/copies.rs:310:21
|
|
|
|
|
|
|
|
|
310 | let _ = if true {
|
|
|
|
| _____________________^ starting here...
|
2017-02-08 07:58:07 -06:00
|
|
|
311 | |
|
2017-02-07 14:05:30 -06:00
|
|
|
312 | | 0.0
|
2017-02-08 07:58:07 -06:00
|
|
|
313 | | } else {
|
2017-02-07 14:05:30 -06:00
|
|
|
| |_____^ ...ending here
|
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
|
|
|
--> $DIR/copies.rs:320:12
|
|
|
|
|
|
2017-02-08 07:58:07 -06:00
|
|
|
320 | } else {
|
2017-02-07 14:05:30 -06:00
|
|
|
| ____________^ starting here...
|
|
|
|
321 | | -0.0
|
|
|
|
322 | | };
|
|
|
|
| |_____^ ...ending here
|
|
|
|
|
|
|
|
|
note: same as this
|
|
|
|
--> $DIR/copies.rs:317:21
|
|
|
|
|
|
|
|
|
317 | let _ = if true {
|
|
|
|
| _____________________^ starting here...
|
2017-02-08 07:58:07 -06:00
|
|
|
318 | |
|
2017-02-07 14:05:30 -06:00
|
|
|
319 | | -0.0
|
2017-02-08 07:58:07 -06:00
|
|
|
320 | | } else {
|
2017-02-07 14:05:30 -06:00
|
|
|
| |_____^ ...ending here
|
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
|
|
|
--> $DIR/copies.rs:341:12
|
|
|
|
|
|
2017-02-08 07:58:07 -06:00
|
|
|
341 | } else {
|
2017-02-07 14:05:30 -06:00
|
|
|
| ____________^ starting here...
|
|
|
|
342 | | std::f32::NAN
|
|
|
|
343 | | };
|
|
|
|
| |_____^ ...ending here
|
|
|
|
|
|
|
|
|
note: same as this
|
|
|
|
--> $DIR/copies.rs:338:21
|
|
|
|
|
|
|
|
|
338 | let _ = if true {
|
|
|
|
| _____________________^ starting here...
|
2017-02-08 07:58:07 -06:00
|
|
|
339 | |
|
2017-02-07 14:05:30 -06:00
|
|
|
340 | | std::f32::NAN
|
2017-02-08 07:58:07 -06:00
|
|
|
341 | | } else {
|
2017-02-07 14:05:30 -06:00
|
|
|
| |_____^ ...ending here
|
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
|
|
|
--> $DIR/copies.rs:360:10
|
|
|
|
|
|
2017-02-08 07:58:07 -06:00
|
|
|
360 | else {
|
2017-02-07 14:05:30 -06:00
|
|
|
| __________^ starting here...
|
|
|
|
361 | | try!(Ok("foo"));
|
|
|
|
362 | | }
|
|
|
|
| |_____^ ...ending here
|
|
|
|
|
|
|
|
|
note: same as this
|
|
|
|
--> $DIR/copies.rs:356:13
|
|
|
|
|
|
|
|
|
356 | if true {
|
|
|
|
| _____________^ starting here...
|
2017-02-08 07:58:07 -06:00
|
|
|
357 | |
|
2017-02-07 14:05:30 -06:00
|
|
|
358 | | try!(Ok("foo"));
|
|
|
|
359 | | }
|
|
|
|
| |_____^ ...ending here
|
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
|
|
|
--> $DIR/copies.rs:373:10
|
|
|
|
|
|
2017-02-08 07:58:07 -06:00
|
|
|
373 | else {
|
2017-02-07 14:05:30 -06:00
|
|
|
| __________^ starting here...
|
|
|
|
374 | | let foo = "";
|
|
|
|
375 | | return Ok(&foo[0..]);
|
|
|
|
376 | | }
|
|
|
|
| |_____^ ...ending here
|
|
|
|
|
|
|
|
|
note: same as this
|
|
|
|
--> $DIR/copies.rs:364:13
|
|
|
|
|
|
|
|
|
364 | if true {
|
|
|
|
| _____________^ starting here...
|
2017-02-08 07:58:07 -06:00
|
|
|
365 | |
|
2017-02-07 14:05:30 -06:00
|
|
|
366 | | let foo = "";
|
|
|
|
367 | | return Ok(&foo[0..]);
|
|
|
|
368 | | }
|
|
|
|
| |_____^ ...ending here
|
|
|
|
|
|
|
|
error: this `if` has the same condition as a previous if
|
|
|
|
--> $DIR/copies.rs:388:13
|
|
|
|
|
|
2017-02-08 07:58:07 -06:00
|
|
|
388 | else if b {
|
2017-02-07 14:05:30 -06:00
|
|
|
| ^
|
|
|
|
|
|
|
|
|
note: lint level defined here
|
|
|
|
--> $DIR/copies.rs:379:8
|
|
|
|
|
|
|
|
|
379 | #[deny(ifs_same_cond)]
|
|
|
|
| ^^^^^^^^^^^^^
|
|
|
|
note: same as this
|
|
|
|
--> $DIR/copies.rs:385:8
|
|
|
|
|
|
|
|
|
385 | if b {
|
|
|
|
| ^
|
|
|
|
|
|
|
|
error: this `if` has the same condition as a previous if
|
|
|
|
--> $DIR/copies.rs:394:13
|
|
|
|
|
|
2017-02-08 07:58:07 -06:00
|
|
|
394 | else if a == 1 {
|
2017-02-07 14:05:30 -06:00
|
|
|
| ^^^^^^
|
|
|
|
|
|
|
|
|
note: same as this
|
|
|
|
--> $DIR/copies.rs:391:8
|
|
|
|
|
|
|
|
|
391 | if a == 1 {
|
|
|
|
| ^^^^^^
|
|
|
|
|
|
|
|
error: this `if` has the same condition as a previous if
|
|
|
|
--> $DIR/copies.rs:402:13
|
|
|
|
|
|
2017-02-08 07:58:07 -06:00
|
|
|
402 | else if 2*a == 1 {
|
2017-02-07 14:05:30 -06:00
|
|
|
| ^^^^^^^^
|
|
|
|
|
|
|
|
|
note: same as this
|
|
|
|
--> $DIR/copies.rs:397:8
|
|
|
|
|
|
|
|
|
397 | if 2*a == 1 {
|
|
|
|
| ^^^^^^^^
|
|
|
|
|
|
|
|
error: aborting due to 22 previous errors
|
|
|
|
|