rust-clippy/tests/ui/copies.stderr

386 lines
8.9 KiB
Text
Raw Normal View History

error: this `if` has identical blocks
2018-10-06 16:18:06 +00:00
--> $DIR/copies.rs:41:10
|
2018-10-06 16:18:06 +00:00
41 | else { //~ ERROR same body as `if` block
| __________^
2018-10-06 16:18:06 +00:00
42 | | Foo { bar: 42 };
43 | | 0..10;
44 | | ..;
... |
2018-10-06 16:18:06 +00:00
48 | | foo();
49 | | }
| |_____^
|
= note: `-D clippy::if-same-then-else` implied by `-D warnings`
note: same as this
2018-10-06 16:18:06 +00:00
--> $DIR/copies.rs:32:13
|
2018-10-06 16:18:06 +00:00
32 | if true {
| _____________^
2018-10-06 16:18:06 +00:00
33 | | Foo { bar: 42 };
34 | | 0..10;
35 | | ..;
... |
2018-10-06 16:18:06 +00:00
39 | | foo();
40 | | }
| |_____^
error: this `match` has identical arm bodies
2018-10-06 16:18:06 +00:00
--> $DIR/copies.rs:90:14
|
2018-10-06 16:18:06 +00:00
90 | _ => { //~ ERROR match arms have same body
| ______________^
2018-10-06 16:18:06 +00:00
91 | | foo();
92 | | let mut a = 42 + [23].len() as i32;
93 | | if true {
... |
2018-10-06 16:18:06 +00:00
97 | | a
98 | | }
| |_________^
|
= note: `-D clippy::match-same-arms` implied by `-D warnings`
note: same as this
2018-10-06 16:18:06 +00:00
--> $DIR/copies.rs:81:15
|
2018-10-06 16:18:06 +00:00
81 | 42 => {
| _______________^
2018-10-06 16:18:06 +00:00
82 | | foo();
83 | | let mut a = 42 + [23].len() as i32;
84 | | if true {
... |
2018-10-06 16:18:06 +00:00
88 | | a
89 | | }
| |_________^
note: `42` has the same arm body as the `_` wildcard, consider removing it`
2018-10-06 16:18:06 +00:00
--> $DIR/copies.rs:81:15
|
2018-10-06 16:18:06 +00:00
81 | 42 => {
| _______________^
2018-10-06 16:18:06 +00:00
82 | | foo();
83 | | let mut a = 42 + [23].len() as i32;
84 | | if true {
... |
2018-10-06 16:18:06 +00:00
88 | | a
89 | | }
| |_________^
error: this `match` has identical arm bodies
2018-10-06 16:18:06 +00:00
--> $DIR/copies.rs:104:14
|
104 | _ => 0, //~ ERROR match arms have same body
| ^
|
note: same as this
2018-10-06 16:18:06 +00:00
--> $DIR/copies.rs:102:19
|
102 | Abc::A => 0,
| ^
note: `Abc::A` has the same arm body as the `_` wildcard, consider removing it`
2018-10-06 16:18:06 +00:00
--> $DIR/copies.rs:102:19
|
102 | Abc::A => 0,
| ^
error: this `if` has identical blocks
2018-10-06 16:18:06 +00:00
--> $DIR/copies.rs:114:10
|
2018-10-06 16:18:06 +00:00
114 | else { //~ ERROR same body as `if` block
| __________^
2018-10-06 16:18:06 +00:00
115 | | 42
116 | | };
| |_____^
|
note: same as this
2018-10-06 16:18:06 +00:00
--> $DIR/copies.rs:111:21
|
2018-10-06 16:18:06 +00:00
111 | let _ = if true {
| _____________________^
2018-10-06 16:18:06 +00:00
112 | | 42
113 | | }
| |_____^
error: this `if` has identical blocks
2018-10-06 16:18:06 +00:00
--> $DIR/copies.rs:128:10
|
2018-10-06 16:18:06 +00:00
128 | else { //~ ERROR same body as `if` block
| __________^
2018-10-06 16:18:06 +00:00
129 | | for _ in &[42] {
130 | | let foo: &Option<_> = &Some::<u8>(42);
131 | | if true {
... |
2018-10-06 16:18:06 +00:00
136 | | }
137 | | }
| |_____^
|
note: same as this
2018-10-06 16:18:06 +00:00
--> $DIR/copies.rs:118:13
|
2018-10-06 16:18:06 +00:00
118 | if true {
| _____________^
2018-10-06 16:18:06 +00:00
119 | | for _ in &[42] {
120 | | let foo: &Option<_> = &Some::<u8>(42);
121 | | if true {
... |
2018-10-06 16:18:06 +00:00
126 | | }
127 | | }
| |_____^
error: this `if` has identical blocks
2018-10-06 16:18:06 +00:00
--> $DIR/copies.rs:150:10
|
2018-10-06 16:18:06 +00:00
150 | else { //~ ERROR same body as `if` block
| __________^
2018-10-06 16:18:06 +00:00
151 | | let bar = if true {
152 | | 42
153 | | }
... |
2018-10-06 16:18:06 +00:00
159 | | bar + 1;
160 | | }
| |_____^
|
note: same as this
2018-10-06 16:18:06 +00:00
--> $DIR/copies.rs:139:13
|
2018-10-06 16:18:06 +00:00
139 | if true {
| _____________^
2018-10-06 16:18:06 +00:00
140 | | let bar = if true {
141 | | 42
142 | | }
... |
2018-10-06 16:18:06 +00:00
148 | | bar + 1;
149 | | }
| |_____^
error: this `if` has identical blocks
2018-10-06 16:18:06 +00:00
--> $DIR/copies.rs:185:10
|
2018-10-06 16:18:06 +00:00
185 | else { //~ ERROR same body as `if` block
| __________^
2018-10-06 16:18:06 +00:00
186 | | if let Some(a) = Some(42) {}
187 | | }
| |_____^
|
note: same as this
2018-10-06 16:18:06 +00:00
--> $DIR/copies.rs:182:13
|
2018-10-06 16:18:06 +00:00
182 | if true {
| _____________^
2018-10-06 16:18:06 +00:00
183 | | if let Some(a) = Some(42) {}
184 | | }
| |_____^
error: this `if` has identical blocks
2018-10-06 16:18:06 +00:00
--> $DIR/copies.rs:192:10
|
2018-10-06 16:18:06 +00:00
192 | else { //~ ERROR same body as `if` block
| __________^
2018-10-06 16:18:06 +00:00
193 | | if let (1, .., 3) = (1, 2, 3) {}
194 | | }
| |_____^
|
note: same as this
2018-10-06 16:18:06 +00:00
--> $DIR/copies.rs:189:13
|
2018-10-06 16:18:06 +00:00
189 | if true {
| _____________^
2018-10-06 16:18:06 +00:00
190 | | if let (1, .., 3) = (1, 2, 3) {}
191 | | }
| |_____^
error: this `match` has identical arm bodies
2018-10-06 16:18:06 +00:00
--> $DIR/copies.rs:247:15
|
2018-10-06 16:18:06 +00:00
247 | 51 => foo(), //~ ERROR match arms have same body
| ^^^^^
|
note: same as this
2018-10-06 16:18:06 +00:00
--> $DIR/copies.rs:246:15
|
2018-10-06 16:18:06 +00:00
246 | 42 => foo(),
| ^^^^^
note: consider refactoring into `42 | 51`
2018-10-06 16:18:06 +00:00
--> $DIR/copies.rs:246:15
|
2018-10-06 16:18:06 +00:00
246 | 42 => foo(),
| ^^^^^
error: this `match` has identical arm bodies
2018-10-06 16:18:06 +00:00
--> $DIR/copies.rs:253:17
|
2018-10-06 16:18:06 +00:00
253 | None => 24, //~ ERROR match arms have same body
| ^^
|
note: same as this
2018-10-06 16:18:06 +00:00
--> $DIR/copies.rs:252:20
|
2018-10-06 16:18:06 +00:00
252 | Some(_) => 24,
| ^^
note: consider refactoring into `Some(_) | None`
2018-10-06 16:18:06 +00:00
--> $DIR/copies.rs:252:20
|
2018-10-06 16:18:06 +00:00
252 | Some(_) => 24,
| ^^
error: this `match` has identical arm bodies
2018-10-06 16:18:06 +00:00
--> $DIR/copies.rs:275:28
|
2018-10-06 16:18:06 +00:00
275 | (None, Some(a)) => bar(a), //~ ERROR match arms have same body
| ^^^^^^
|
note: same as this
2018-10-06 16:18:06 +00:00
--> $DIR/copies.rs:274:28
|
2018-10-06 16:18:06 +00:00
274 | (Some(a), None) => bar(a),
| ^^^^^^
note: consider refactoring into `(Some(a), None) | (None, Some(a))`
2018-10-06 16:18:06 +00:00
--> $DIR/copies.rs:274:28
|
2018-10-06 16:18:06 +00:00
274 | (Some(a), None) => bar(a),
| ^^^^^^
error: this `match` has identical arm bodies
2018-10-06 16:18:06 +00:00
--> $DIR/copies.rs:281:26
|
2018-10-06 16:18:06 +00:00
281 | (.., Some(a)) => bar(a), //~ ERROR match arms have same body
| ^^^^^^
|
note: same as this
2018-10-06 16:18:06 +00:00
--> $DIR/copies.rs:280:26
|
2018-10-06 16:18:06 +00:00
280 | (Some(a), ..) => bar(a),
| ^^^^^^
note: consider refactoring into `(Some(a), ..) | (.., Some(a))`
2018-10-06 16:18:06 +00:00
--> $DIR/copies.rs:280:26
|
2018-10-06 16:18:06 +00:00
280 | (Some(a), ..) => bar(a),
| ^^^^^^
error: this `match` has identical arm bodies
2018-10-06 16:18:06 +00:00
--> $DIR/copies.rs:287:20
|
2018-10-06 16:18:06 +00:00
287 | (.., 3) => 42, //~ ERROR match arms have same body
| ^^
|
note: same as this
2018-10-06 16:18:06 +00:00
--> $DIR/copies.rs:286:23
|
2018-10-06 16:18:06 +00:00
286 | (1, .., 3) => 42,
| ^^
note: consider refactoring into `(1, .., 3) | (.., 3)`
2018-10-06 16:18:06 +00:00
--> $DIR/copies.rs:286:23
|
2018-10-06 16:18:06 +00:00
286 | (1, .., 3) => 42,
| ^^
error: this `if` has identical blocks
2018-10-06 16:18:06 +00:00
--> $DIR/copies.rs:293:12
|
2018-10-06 16:18:06 +00:00
293 | } else { //~ ERROR same body as `if` block
| ____________^
2018-10-06 16:18:06 +00:00
294 | | 0.0
295 | | };
| |_____^
|
note: same as this
2018-10-06 16:18:06 +00:00
--> $DIR/copies.rs:291:21
|
2018-10-06 16:18:06 +00:00
291 | let _ = if true {
| _____________________^
2018-10-06 16:18:06 +00:00
292 | | 0.0
293 | | } else { //~ ERROR same body as `if` block
| |_____^
error: this `if` has identical blocks
2018-10-06 16:18:06 +00:00
--> $DIR/copies.rs:299:12
|
2018-10-06 16:18:06 +00:00
299 | } else { //~ ERROR same body as `if` block
| ____________^
2018-10-06 16:18:06 +00:00
300 | | -0.0
301 | | };
| |_____^
|
note: same as this
2018-10-06 16:18:06 +00:00
--> $DIR/copies.rs:297:21
|
2018-10-06 16:18:06 +00:00
297 | let _ = if true {
| _____________________^
2018-10-06 16:18:06 +00:00
298 | | -0.0
299 | | } else { //~ ERROR same body as `if` block
| |_____^
error: this `if` has identical blocks
2018-10-06 16:18:06 +00:00
--> $DIR/copies.rs:319:12
|
2018-10-06 16:18:06 +00:00
319 | } else { //~ ERROR same body as `if` block
| ____________^
2018-10-06 16:18:06 +00:00
320 | | std::f32::NAN
321 | | };
| |_____^
|
note: same as this
2018-10-06 16:18:06 +00:00
--> $DIR/copies.rs:317:21
|
2018-10-06 16:18:06 +00:00
317 | let _ = if true {
| _____________________^
2018-10-06 16:18:06 +00:00
318 | | std::f32::NAN
319 | | } else { //~ ERROR same body as `if` block
| |_____^
error: this `if` has identical blocks
2018-10-06 16:18:06 +00:00
--> $DIR/copies.rs:337:10
|
2018-10-06 16:18:06 +00:00
337 | else { //~ ERROR same body as `if` block
| __________^
2018-10-06 16:18:06 +00:00
338 | | try!(Ok("foo"));
339 | | }
| |_____^
|
note: same as this
2018-10-06 16:18:06 +00:00
--> $DIR/copies.rs:334:13
|
2018-10-06 16:18:06 +00:00
334 | if true {
| _____________^
2018-10-06 16:18:06 +00:00
335 | | try!(Ok("foo"));
336 | | }
| |_____^
error: this `if` has the same condition as a previous if
2018-10-06 16:18:06 +00:00
--> $DIR/copies.rs:363:13
|
2018-10-06 16:18:06 +00:00
363 | else if b { //~ ERROR ifs same condition
| ^
|
= note: `-D clippy::ifs-same-cond` implied by `-D warnings`
note: same as this
2018-10-06 16:18:06 +00:00
--> $DIR/copies.rs:361:8
|
2018-10-06 16:18:06 +00:00
361 | if b {
| ^
error: this `if` has the same condition as a previous if
2018-10-06 16:18:06 +00:00
--> $DIR/copies.rs:368:13
|
2018-10-06 16:18:06 +00:00
368 | else if a == 1 { //~ ERROR ifs same condition
| ^^^^^^
|
note: same as this
2018-10-06 16:18:06 +00:00
--> $DIR/copies.rs:366:8
|
2018-10-06 16:18:06 +00:00
366 | if a == 1 {
| ^^^^^^
error: this `if` has the same condition as a previous if
2018-10-06 16:18:06 +00:00
--> $DIR/copies.rs:375:13
|
2018-10-06 16:18:06 +00:00
375 | else if 2*a == 1 { //~ ERROR ifs same condition
| ^^^^^^^^
|
note: same as this
2018-10-06 16:18:06 +00:00
--> $DIR/copies.rs:371:8
|
2018-10-06 16:18:06 +00:00
371 | if 2*a == 1 {
| ^^^^^^^^
error: aborting due to 20 previous errors
2018-01-16 16:06:27 +00:00