rust-clippy/tests/ui/copies.stderr

356 lines
7.9 KiB
Text
Raw Normal View History

error: this `if` has identical blocks
--> $DIR/copies.rs:41:12
|
2018-12-27 15:57:55 +00:00
LL | } else {
2018-12-10 05:27:19 +00:00
| ____________^
2018-12-27 15:57:55 +00:00
LL | | //~ ERROR same body as `if` block
LL | | Foo { bar: 42 };
LL | | 0..10;
... |
2018-12-27 15:57:55 +00:00
LL | | foo();
LL | | }
| |_____^
|
= note: `-D clippy::if-same-then-else` implied by `-D warnings`
note: same as this
--> $DIR/copies.rs:33:13
|
2018-12-27 15:57:55 +00:00
LL | if true {
| _____________^
2018-12-27 15:57:55 +00:00
LL | | Foo { bar: 42 };
LL | | 0..10;
LL | | ..;
... |
2018-12-27 15:57:55 +00:00
LL | | foo();
LL | | } else {
| |_____^
error: this `match` has identical arm bodies
--> $DIR/copies.rs:87:14
2018-12-27 15:57:55 +00:00
|
LL | _ => {
| ______________^
LL | | //~ ERROR match arms have same body
LL | | foo();
LL | | let mut a = 42 + [23].len() as i32;
... |
LL | | a
LL | | },
| |_________^
|
= note: `-D clippy::match-same-arms` implied by `-D warnings`
note: same as this
--> $DIR/copies.rs:78:15
2018-12-27 15:57:55 +00:00
|
LL | 42 => {
| _______________^
LL | | foo();
LL | | let mut a = 42 + [23].len() as i32;
LL | | if true {
... |
LL | | a
LL | | },
| |_________^
note: `42` has the same arm body as the `_` wildcard, consider removing it`
--> $DIR/copies.rs:78:15
2018-12-27 15:57:55 +00:00
|
LL | 42 => {
| _______________^
LL | | foo();
LL | | let mut a = 42 + [23].len() as i32;
LL | | if true {
... |
LL | | a
LL | | },
| |_________^
error: this `match` has identical arm bodies
--> $DIR/copies.rs:102:14
2018-12-27 15:57:55 +00:00
|
LL | _ => 0, //~ ERROR match arms have same body
| ^
|
note: same as this
--> $DIR/copies.rs:100:19
2018-12-27 15:57:55 +00:00
|
LL | Abc::A => 0,
| ^
note: `Abc::A` has the same arm body as the `_` wildcard, consider removing it`
--> $DIR/copies.rs:100:19
2018-12-27 15:57:55 +00:00
|
LL | Abc::A => 0,
| ^
error: this `if` has identical blocks
--> $DIR/copies.rs:111:12
2018-12-27 15:57:55 +00:00
|
LL | } else {
| ____________^
LL | | //~ ERROR same body as `if` block
LL | | 42
LL | | };
| |_____^
|
note: same as this
--> $DIR/copies.rs:109:21
2018-12-27 15:57:55 +00:00
|
LL | let _ = if true {
| _____________________^
LL | | 42
LL | | } else {
| |_____^
error: this `if` has identical blocks
--> $DIR/copies.rs:125:12
2018-12-27 15:57:55 +00:00
|
LL | } else {
| ____________^
LL | | //~ ERROR same body as `if` block
LL | | for _ in &[42] {
LL | | let foo: &Option<_> = &Some::<u8>(42);
... |
LL | | }
LL | | }
| |_____^
|
note: same as this
--> $DIR/copies.rs:116:13
2018-12-27 15:57:55 +00:00
|
LL | if true {
| _____________^
LL | | for _ in &[42] {
LL | | let foo: &Option<_> = &Some::<u8>(42);
LL | | if true {
... |
LL | | }
LL | | } else {
| |_____^
error: this `if` has identical blocks
--> $DIR/copies.rs:144:12
2018-12-27 15:57:55 +00:00
|
LL | } else {
| ____________^
LL | | //~ ERROR same body as `if` block
LL | | let bar = if true { 42 } else { 43 };
LL | |
... |
LL | | bar + 1;
LL | | }
| |_____^
|
note: same as this
--> $DIR/copies.rs:137:13
2018-12-27 15:57:55 +00:00
|
LL | if true {
| _____________^
LL | | let bar = if true { 42 } else { 43 };
LL | |
LL | | while foo() {
... |
LL | | bar + 1;
LL | | } else {
| |_____^
error: this `if` has identical blocks
--> $DIR/copies.rs:174:12
2018-12-27 15:57:55 +00:00
|
LL | } else {
| ____________^
LL | | //~ ERROR same body as `if` block
LL | | if let Some(a) = Some(42) {}
LL | | }
| |_____^
|
note: same as this
--> $DIR/copies.rs:172:13
2018-12-27 15:57:55 +00:00
|
LL | if true {
| _____________^
LL | | if let Some(a) = Some(42) {}
LL | | } else {
| |_____^
error: this `if` has identical blocks
--> $DIR/copies.rs:181:12
2018-12-27 15:57:55 +00:00
|
LL | } else {
| ____________^
LL | | //~ ERROR same body as `if` block
LL | | if let (1, .., 3) = (1, 2, 3) {}
LL | | }
| |_____^
|
note: same as this
--> $DIR/copies.rs:179:13
2018-12-27 15:57:55 +00:00
|
LL | if true {
| _____________^
LL | | if let (1, .., 3) = (1, 2, 3) {}
LL | | } else {
| |_____^
error: this `match` has identical arm bodies
--> $DIR/copies.rs:230:15
2018-12-27 15:57:55 +00:00
|
LL | 51 => foo(), //~ ERROR match arms have same body
| ^^^^^
|
note: same as this
--> $DIR/copies.rs:229:15
2018-12-27 15:57:55 +00:00
|
LL | 42 => foo(),
| ^^^^^
note: consider refactoring into `42 | 51`
--> $DIR/copies.rs:229:15
2018-12-27 15:57:55 +00:00
|
LL | 42 => foo(),
| ^^^^^
error: this `match` has identical arm bodies
--> $DIR/copies.rs:236:17
2018-12-27 15:57:55 +00:00
|
LL | None => 24, //~ ERROR match arms have same body
| ^^
|
note: same as this
--> $DIR/copies.rs:235:20
2018-12-27 15:57:55 +00:00
|
LL | Some(_) => 24,
| ^^
note: consider refactoring into `Some(_) | None`
--> $DIR/copies.rs:235:20
2018-12-27 15:57:55 +00:00
|
LL | Some(_) => 24,
| ^^
error: this `match` has identical arm bodies
--> $DIR/copies.rs:258:28
2018-12-27 15:57:55 +00:00
|
LL | (None, Some(a)) => bar(a), //~ ERROR match arms have same body
| ^^^^^^
|
note: same as this
--> $DIR/copies.rs:257:28
2018-12-27 15:57:55 +00:00
|
LL | (Some(a), None) => bar(a),
| ^^^^^^
note: consider refactoring into `(Some(a), None) | (None, Some(a))`
--> $DIR/copies.rs:257:28
2018-12-27 15:57:55 +00:00
|
LL | (Some(a), None) => bar(a),
| ^^^^^^
error: this `match` has identical arm bodies
--> $DIR/copies.rs:264:26
2018-12-27 15:57:55 +00:00
|
LL | (.., Some(a)) => bar(a), //~ ERROR match arms have same body
| ^^^^^^
|
note: same as this
--> $DIR/copies.rs:263:26
2018-12-27 15:57:55 +00:00
|
LL | (Some(a), ..) => bar(a),
| ^^^^^^
note: consider refactoring into `(Some(a), ..) | (.., Some(a))`
--> $DIR/copies.rs:263:26
2018-12-27 15:57:55 +00:00
|
LL | (Some(a), ..) => bar(a),
| ^^^^^^
error: this `match` has identical arm bodies
--> $DIR/copies.rs:270:20
2018-12-27 15:57:55 +00:00
|
LL | (.., 3) => 42, //~ ERROR match arms have same body
| ^^
|
note: same as this
--> $DIR/copies.rs:269:23
2018-12-27 15:57:55 +00:00
|
LL | (1, .., 3) => 42,
| ^^
note: consider refactoring into `(1, .., 3) | (.., 3)`
--> $DIR/copies.rs:269:23
2018-12-27 15:57:55 +00:00
|
LL | (1, .., 3) => 42,
| ^^
error: this `if` has identical blocks
--> $DIR/copies.rs:276:12
2018-12-27 15:57:55 +00:00
|
LL | } else {
| ____________^
LL | | //~ ERROR same body as `if` block
LL | | 0.0
LL | | };
| |_____^
|
note: same as this
--> $DIR/copies.rs:274:21
2018-12-27 15:57:55 +00:00
|
LL | let _ = if true {
| _____________________^
LL | | 0.0
LL | | } else {
| |_____^
error: this `if` has identical blocks
--> $DIR/copies.rs:283:12
2018-12-27 15:57:55 +00:00
|
LL | } else {
| ____________^
LL | | //~ ERROR same body as `if` block
LL | | -0.0
LL | | };
| |_____^
|
note: same as this
--> $DIR/copies.rs:281:21
2018-12-27 15:57:55 +00:00
|
LL | let _ = if true {
| _____________________^
LL | | -0.0
LL | | } else {
| |_____^
error: this `if` has identical blocks
--> $DIR/copies.rs:296:12
2018-12-27 15:57:55 +00:00
|
LL | } else {
| ____________^
LL | | //~ ERROR same body as `if` block
LL | | std::f32::NAN
LL | | };
| |_____^
|
note: same as this
--> $DIR/copies.rs:294:21
2018-12-27 15:57:55 +00:00
|
LL | let _ = if true {
| _____________________^
LL | | std::f32::NAN
LL | | } else {
| |_____^
error: this `if` has identical blocks
--> $DIR/copies.rs:314:12
2018-12-27 15:57:55 +00:00
|
LL | } else {
| ____________^
LL | | //~ ERROR same body as `if` block
LL | | try!(Ok("foo"));
LL | | }
| |_____^
|
note: same as this
--> $DIR/copies.rs:312:13
2018-12-27 15:57:55 +00:00
|
LL | if true {
| _____________^
LL | | try!(Ok("foo"));
LL | | } else {
| |_____^
error: aborting due to 17 previous errors
2018-01-16 16:06:27 +00:00