rust/tests/ui/copies.stderr

393 lines
9.0 KiB
Plaintext
Raw Normal View History

error: this `if` has identical blocks
2018-12-09 23:27:19 -06:00
--> $DIR/copies.rs:50:12
|
2018-12-09 23:27:19 -06:00
50 | } else {
| ____________^
51 | | //~ ERROR same body as `if` block
52 | | Foo { bar: 42 };
53 | | 0..10;
... |
2018-12-09 23:27:19 -06:00
58 | | foo();
59 | | }
| |_____^
|
= note: `-D clippy::if-same-then-else` implied by `-D warnings`
note: same as this
2018-12-09 23:27:19 -06:00
--> $DIR/copies.rs:42:13
|
2018-12-09 23:27:19 -06:00
42 | if true {
| _____________^
2018-12-09 23:27:19 -06:00
43 | | Foo { bar: 42 };
44 | | 0..10;
45 | | ..;
... |
2018-12-09 23:27:19 -06:00
49 | | foo();
50 | | } else {
| |_____^
error: this `match` has identical arm bodies
2018-12-09 23:27:19 -06:00
--> $DIR/copies.rs:96:14
|
96 | _ => {
| ______________^
97 | | //~ ERROR match arms have same body
98 | | foo();
99 | | let mut a = 42 + [23].len() as i32;
... |
104 | | a
105 | | },
| |_________^
|
= note: `-D clippy::match-same-arms` implied by `-D warnings`
note: same as this
2018-12-09 23:27:19 -06:00
--> $DIR/copies.rs:87:15
|
87 | 42 => {
| _______________^
88 | | foo();
89 | | let mut a = 42 + [23].len() as i32;
90 | | if true {
... |
94 | | a
95 | | },
| |_________^
note: `42` has the same arm body as the `_` wildcard, consider removing it`
2018-12-09 23:27:19 -06:00
--> $DIR/copies.rs:87:15
|
87 | 42 => {
| _______________^
88 | | foo();
89 | | let mut a = 42 + [23].len() as i32;
90 | | if true {
... |
94 | | a
95 | | },
| |_________^
error: this `match` has identical arm bodies
2018-12-09 23:27:19 -06:00
--> $DIR/copies.rs:111:14
2018-10-06 11:18:06 -05:00
|
2018-12-09 23:27:19 -06:00
111 | _ => 0, //~ ERROR match arms have same body
2018-10-06 11:18:06 -05:00
| ^
|
note: same as this
2018-12-09 23:27:19 -06:00
--> $DIR/copies.rs:109:19
2018-10-06 11:18:06 -05:00
|
2018-12-09 23:27:19 -06:00
109 | Abc::A => 0,
2018-10-06 11:18:06 -05:00
| ^
note: `Abc::A` has the same arm body as the `_` wildcard, consider removing it`
2018-12-09 23:27:19 -06:00
--> $DIR/copies.rs:109:19
2018-10-06 11:18:06 -05:00
|
2018-12-09 23:27:19 -06:00
109 | Abc::A => 0,
2018-10-06 11:18:06 -05:00
| ^
error: this `if` has identical blocks
2018-12-09 23:27:19 -06:00
--> $DIR/copies.rs:120:12
|
2018-12-09 23:27:19 -06:00
120 | } else {
| ____________^
121 | | //~ ERROR same body as `if` block
122 | | 42
123 | | };
| |_____^
|
note: same as this
2018-12-09 23:27:19 -06:00
--> $DIR/copies.rs:118:21
|
2018-12-09 23:27:19 -06:00
118 | let _ = if true {
| _____________________^
2018-12-09 23:27:19 -06:00
119 | | 42
120 | | } else {
| |_____^
error: this `if` has identical blocks
2018-12-09 23:27:19 -06:00
--> $DIR/copies.rs:134:12
|
2018-12-09 23:27:19 -06:00
134 | } else {
| ____________^
135 | | //~ ERROR same body as `if` block
136 | | for _ in &[42] {
137 | | let foo: &Option<_> = &Some::<u8>(42);
... |
2018-12-09 23:27:19 -06:00
143 | | }
144 | | }
| |_____^
|
note: same as this
2018-12-09 23:27:19 -06:00
--> $DIR/copies.rs:125:13
|
2018-12-09 23:27:19 -06:00
125 | if true {
| _____________^
2018-12-09 23:27:19 -06:00
126 | | for _ in &[42] {
127 | | let foo: &Option<_> = &Some::<u8>(42);
128 | | if true {
... |
2018-12-09 23:27:19 -06:00
133 | | }
134 | | } else {
| |_____^
error: this `if` has identical blocks
2018-12-09 23:27:19 -06:00
--> $DIR/copies.rs:153:12
|
2018-12-09 23:27:19 -06:00
153 | } else {
| ____________^
154 | | //~ ERROR same body as `if` block
155 | | let bar = if true { 42 } else { 43 };
156 | |
... |
2018-12-09 23:27:19 -06:00
160 | | bar + 1;
161 | | }
| |_____^
|
note: same as this
2018-12-09 23:27:19 -06:00
--> $DIR/copies.rs:146:13
|
2018-12-09 23:27:19 -06:00
146 | if true {
| _____________^
2018-12-09 23:27:19 -06:00
147 | | let bar = if true { 42 } else { 43 };
148 | |
149 | | while foo() {
... |
2018-12-09 23:27:19 -06:00
152 | | bar + 1;
153 | | } else {
| |_____^
error: this `if` has identical blocks
2018-12-09 23:27:19 -06:00
--> $DIR/copies.rs:183:12
|
2018-12-09 23:27:19 -06:00
183 | } else {
| ____________^
184 | | //~ ERROR same body as `if` block
185 | | if let Some(a) = Some(42) {}
186 | | }
| |_____^
|
note: same as this
2018-12-09 23:27:19 -06:00
--> $DIR/copies.rs:181:13
|
2018-12-09 23:27:19 -06:00
181 | if true {
| _____________^
2018-12-09 23:27:19 -06:00
182 | | if let Some(a) = Some(42) {}
183 | | } else {
| |_____^
error: this `if` has identical blocks
2018-12-09 23:27:19 -06:00
--> $DIR/copies.rs:190:12
|
2018-12-09 23:27:19 -06:00
190 | } else {
| ____________^
191 | | //~ ERROR same body as `if` block
192 | | if let (1, .., 3) = (1, 2, 3) {}
193 | | }
| |_____^
|
note: same as this
2018-12-09 23:27:19 -06:00
--> $DIR/copies.rs:188:13
|
2018-12-09 23:27:19 -06:00
188 | if true {
| _____________^
2018-12-09 23:27:19 -06:00
189 | | if let (1, .., 3) = (1, 2, 3) {}
190 | | } else {
| |_____^
error: this `match` has identical arm bodies
2018-12-09 23:27:19 -06:00
--> $DIR/copies.rs:239:15
|
2018-12-09 23:27:19 -06:00
239 | 51 => foo(), //~ ERROR match arms have same body
| ^^^^^
|
note: same as this
2018-12-09 23:27:19 -06:00
--> $DIR/copies.rs:238:15
|
2018-12-09 23:27:19 -06:00
238 | 42 => foo(),
| ^^^^^
note: consider refactoring into `42 | 51`
2018-12-09 23:27:19 -06:00
--> $DIR/copies.rs:238:15
|
2018-12-09 23:27:19 -06:00
238 | 42 => foo(),
| ^^^^^
error: this `match` has identical arm bodies
2018-12-09 23:27:19 -06:00
--> $DIR/copies.rs:245:17
|
2018-12-09 23:27:19 -06:00
245 | None => 24, //~ ERROR match arms have same body
| ^^
|
note: same as this
2018-12-09 23:27:19 -06:00
--> $DIR/copies.rs:244:20
|
2018-12-09 23:27:19 -06:00
244 | Some(_) => 24,
| ^^
note: consider refactoring into `Some(_) | None`
2018-12-09 23:27:19 -06:00
--> $DIR/copies.rs:244:20
|
2018-12-09 23:27:19 -06:00
244 | Some(_) => 24,
| ^^
error: this `match` has identical arm bodies
2018-12-09 23:27:19 -06:00
--> $DIR/copies.rs:267:28
|
2018-12-09 23:27:19 -06:00
267 | (None, Some(a)) => bar(a), //~ ERROR match arms have same body
| ^^^^^^
|
note: same as this
2018-12-09 23:27:19 -06:00
--> $DIR/copies.rs:266:28
|
2018-12-09 23:27:19 -06:00
266 | (Some(a), None) => bar(a),
| ^^^^^^
note: consider refactoring into `(Some(a), None) | (None, Some(a))`
2018-12-09 23:27:19 -06:00
--> $DIR/copies.rs:266:28
|
2018-12-09 23:27:19 -06:00
266 | (Some(a), None) => bar(a),
| ^^^^^^
error: this `match` has identical arm bodies
2018-12-09 23:27:19 -06:00
--> $DIR/copies.rs:273:26
|
2018-12-09 23:27:19 -06:00
273 | (.., Some(a)) => bar(a), //~ ERROR match arms have same body
| ^^^^^^
|
note: same as this
2018-12-09 23:27:19 -06:00
--> $DIR/copies.rs:272:26
|
2018-12-09 23:27:19 -06:00
272 | (Some(a), ..) => bar(a),
| ^^^^^^
note: consider refactoring into `(Some(a), ..) | (.., Some(a))`
2018-12-09 23:27:19 -06:00
--> $DIR/copies.rs:272:26
|
2018-12-09 23:27:19 -06:00
272 | (Some(a), ..) => bar(a),
| ^^^^^^
error: this `match` has identical arm bodies
2018-12-09 23:27:19 -06:00
--> $DIR/copies.rs:279:20
|
2018-12-09 23:27:19 -06:00
279 | (.., 3) => 42, //~ ERROR match arms have same body
| ^^
|
note: same as this
2018-12-09 23:27:19 -06:00
--> $DIR/copies.rs:278:23
|
2018-12-09 23:27:19 -06:00
278 | (1, .., 3) => 42,
| ^^
note: consider refactoring into `(1, .., 3) | (.., 3)`
2018-12-09 23:27:19 -06:00
--> $DIR/copies.rs:278:23
|
2018-12-09 23:27:19 -06:00
278 | (1, .., 3) => 42,
| ^^
error: this `if` has identical blocks
2018-12-09 23:27:19 -06:00
--> $DIR/copies.rs:285:12
|
2018-12-09 23:27:19 -06:00
285 | } else {
| ____________^
2018-12-09 23:27:19 -06:00
286 | | //~ ERROR same body as `if` block
287 | | 0.0
288 | | };
| |_____^
|
note: same as this
2018-12-09 23:27:19 -06:00
--> $DIR/copies.rs:283:21
|
2018-12-09 23:27:19 -06:00
283 | let _ = if true {
| _____________________^
2018-12-09 23:27:19 -06:00
284 | | 0.0
285 | | } else {
| |_____^
error: this `if` has identical blocks
2018-12-09 23:27:19 -06:00
--> $DIR/copies.rs:292:12
|
2018-12-09 23:27:19 -06:00
292 | } else {
| ____________^
2018-12-09 23:27:19 -06:00
293 | | //~ ERROR same body as `if` block
294 | | -0.0
295 | | };
| |_____^
|
note: same as this
2018-12-09 23:27:19 -06:00
--> $DIR/copies.rs:290:21
|
2018-12-09 23:27:19 -06:00
290 | let _ = if true {
| _____________________^
2018-12-09 23:27:19 -06:00
291 | | -0.0
292 | | } else {
| |_____^
error: this `if` has identical blocks
2018-12-09 23:27:19 -06:00
--> $DIR/copies.rs:305:12
|
2018-12-09 23:27:19 -06:00
305 | } else {
| ____________^
2018-12-09 23:27:19 -06:00
306 | | //~ ERROR same body as `if` block
307 | | std::f32::NAN
308 | | };
| |_____^
|
note: same as this
2018-12-09 23:27:19 -06:00
--> $DIR/copies.rs:303:21
|
2018-12-09 23:27:19 -06:00
303 | let _ = if true {
| _____________________^
2018-12-09 23:27:19 -06:00
304 | | std::f32::NAN
305 | | } else {
| |_____^
error: this `if` has identical blocks
2018-12-09 23:27:19 -06:00
--> $DIR/copies.rs:323:12
|
2018-12-09 23:27:19 -06:00
323 | } else {
| ____________^
324 | | //~ ERROR same body as `if` block
325 | | try!(Ok("foo"));
326 | | }
| |_____^
|
note: same as this
2018-12-09 23:27:19 -06:00
--> $DIR/copies.rs:321:13
|
2018-12-09 23:27:19 -06:00
321 | if true {
| _____________^
2018-12-09 23:27:19 -06:00
322 | | try!(Ok("foo"));
323 | | } else {
| |_____^
error: this `if` has the same condition as a previous if
2018-12-09 23:27:19 -06:00
--> $DIR/copies.rs:347:15
|
2018-12-09 23:27:19 -06:00
347 | } else if b {
| ^
|
= note: `-D clippy::ifs-same-cond` implied by `-D warnings`
note: same as this
2018-12-09 23:27:19 -06:00
--> $DIR/copies.rs:346:8
|
2018-12-09 23:27:19 -06:00
346 | if b {
| ^
error: this `if` has the same condition as a previous if
2018-12-09 23:27:19 -06:00
--> $DIR/copies.rs:352:15
|
2018-12-09 23:27:19 -06:00
352 | } else if a == 1 {
| ^^^^^^
|
note: same as this
2018-12-09 23:27:19 -06:00
--> $DIR/copies.rs:351:8
|
2018-12-09 23:27:19 -06:00
351 | if a == 1 {
| ^^^^^^
error: this `if` has the same condition as a previous if
2018-12-09 23:27:19 -06:00
--> $DIR/copies.rs:358:15
|
2018-12-09 23:27:19 -06:00
358 | } else if 2 * a == 1 {
| ^^^^^^^^^^
|
note: same as this
2018-12-09 23:27:19 -06:00
--> $DIR/copies.rs:356:8
|
2018-12-09 23:27:19 -06:00
356 | if 2 * a == 1 {
| ^^^^^^^^^^
error: aborting due to 20 previous errors
2018-01-16 10:06:27 -06:00