rust-clippy/tests/ui/if_same_then_else.stderr

131 lines
2.5 KiB
Text
Raw Normal View History

error: this `if` has identical blocks
--> $DIR/if_same_then_else.rs:23:13
|
LL | if true {
| _____________^
2023-04-20 15:19:36 +00:00
LL | |
LL | | Foo { bar: 42 };
LL | | 0..10;
... |
LL | | foo();
LL | | } else {
| |_____^
|
note: same as this
2023-04-20 15:19:36 +00:00
--> $DIR/if_same_then_else.rs:32:12
|
LL | } else {
| ____________^
LL | | Foo { bar: 42 };
LL | | 0..10;
2023-04-20 15:19:36 +00:00
LL | | ..;
... |
LL | | foo();
LL | | }
| |_____^
2022-09-22 16:04:22 +00:00
= note: `-D clippy::if-same-then-else` implied by `-D warnings`
error: this `if` has identical blocks
--> $DIR/if_same_then_else.rs:67:21
|
LL | let _ = if true {
| _____________________^
2023-04-20 15:19:36 +00:00
LL | |
LL | | 0.0
LL | | } else {
| |_____^
|
note: same as this
2023-04-20 15:19:36 +00:00
--> $DIR/if_same_then_else.rs:70:12
|
LL | } else {
| ____________^
LL | | 0.0
LL | | };
| |_____^
error: this `if` has identical blocks
--> $DIR/if_same_then_else.rs:74:21
|
LL | let _ = if true {
| _____________________^
2023-04-20 15:19:36 +00:00
LL | |
LL | | -0.0
LL | | } else {
| |_____^
|
note: same as this
2023-04-20 15:19:36 +00:00
--> $DIR/if_same_then_else.rs:77:12
|
LL | } else {
| ____________^
LL | | -0.0
LL | | };
| |_____^
error: this `if` has identical blocks
--> $DIR/if_same_then_else.rs:90:21
|
LL | let _ = if true {
| _____________________^
2023-04-20 15:19:36 +00:00
LL | |
LL | | 42
LL | | } else {
| |_____^
|
note: same as this
2023-04-20 15:19:36 +00:00
--> $DIR/if_same_then_else.rs:93:12
|
LL | } else {
| ____________^
LL | | 42
LL | | };
| |_____^
error: this `if` has identical blocks
--> $DIR/if_same_then_else.rs:97:13
|
LL | if true {
| _____________^
2023-04-20 15:19:36 +00:00
LL | |
LL | | let bar = if true { 42 } else { 43 };
LL | |
... |
LL | | bar + 1;
LL | | } else {
| |_____^
|
note: same as this
2023-04-20 15:19:36 +00:00
--> $DIR/if_same_then_else.rs:105:12
|
LL | } else {
| ____________^
LL | | let bar = if true { 42 } else { 43 };
LL | |
2023-04-20 15:19:36 +00:00
LL | | while foo() {
... |
LL | | bar + 1;
LL | | }
| |_____^
error: this `if` has identical blocks
--> $DIR/if_same_then_else.rs:250:14
|
LL | if x {
| ______________^
LL | | 0_u8.is_power_of_two()
LL | | } else {
| |_________^
|
note: same as this
--> $DIR/if_same_then_else.rs:252:16
|
LL | } else {
| ________________^
LL | | 0_u8.is_power_of_two()
LL | | }
| |_________^
error: aborting due to 6 previous errors