| error: this `if` has identical blocks | |
| --> tests/ui/if_same_then_else.rs:21:13 | |
| | | |
| LL | if true { | |
| | _____________^ | |
| LL | | Foo { bar: 42 }; | |
| LL | | 0..10; | |
| LL | | ..; | |
| ... | | |
| LL | | foo(); | |
| LL | | } else { | |
| | |_____^ | |
| | | |
| note: same as this | |
| --> tests/ui/if_same_then_else.rs:29:12 | |
| | | |
| LL | } else { | |
| | ____________^ | |
| LL | | Foo { bar: 42 }; | |
| LL | | 0..10; | |
| LL | | ..; | |
| ... | | |
| LL | | foo(); | |
| LL | | } | |
| | |_____^ | |
| = note: `-D clippy::if-same-then-else` implied by `-D warnings` | |
| = help: to override `-D warnings` add `#[allow(clippy::if_same_then_else)]` | |
| error: this `if` has identical blocks | |
| --> tests/ui/if_same_then_else.rs:65:21 | |
| | | |
| LL | let _ = if true { 0.0 } else { 0.0 }; | |
| | ^^^^^^^ | |
| | | |
| note: same as this | |
| --> tests/ui/if_same_then_else.rs:65:34 | |
| | | |
| LL | let _ = if true { 0.0 } else { 0.0 }; | |
| | ^^^^^^^ | |
| error: this `if` has identical blocks | |
| --> tests/ui/if_same_then_else.rs:68:21 | |
| | | |
| LL | let _ = if true { -0.0 } else { -0.0 }; | |
| | ^^^^^^^^ | |
| | | |
| note: same as this | |
| --> tests/ui/if_same_then_else.rs:68:35 | |
| | | |
| LL | let _ = if true { -0.0 } else { -0.0 }; | |
| | ^^^^^^^^ | |
| error: this `if` has identical blocks | |
| --> tests/ui/if_same_then_else.rs:80:21 | |
| | | |
| LL | let _ = if true { 42 } else { 42 }; | |
| | ^^^^^^ | |
| | | |
| note: same as this | |
| --> tests/ui/if_same_then_else.rs:80:33 | |
| | | |
| LL | let _ = if true { 42 } else { 42 }; | |
| | ^^^^^^ | |
| error: this `if` has identical blocks | |
| --> tests/ui/if_same_then_else.rs:83:13 | |
| | | |
| LL | if true { | |
| | _____________^ | |
| LL | | let bar = if true { 42 } else { 43 }; | |
| LL | | | |
| LL | | while foo() { | |
| ... | | |
| LL | | bar + 1; | |
| LL | | } else { | |
| | |_____^ | |
| | | |
| note: same as this | |
| --> tests/ui/if_same_then_else.rs:90:12 | |
| | | |
| LL | } else { | |
| | ____________^ | |
| LL | | let bar = if true { 42 } else { 43 }; | |
| LL | | | |
| LL | | while foo() { | |
| ... | | |
| LL | | bar + 1; | |
| LL | | } | |
| | |_____^ | |
| error: this `if` has identical blocks | |
| --> tests/ui/if_same_then_else.rs:224:14 | |
| | | |
| LL | if x { | |
| | ______________^ | |
| LL | | 0_u8.is_power_of_two() | |
| LL | | } else { | |
| | |_________^ | |
| | | |
| note: same as this | |
| --> tests/ui/if_same_then_else.rs:226:16 | |
| | | |
| LL | } else { | |
| | ________________^ | |
| LL | | 0_u8.is_power_of_two() | |
| LL | | } | |
| | |_________^ | |
| error: this `if` has identical blocks | |
| --> tests/ui/if_same_then_else.rs:253:14 | |
| | | |
| LL | _ = if x { a == b } else { b == a }; | |
| | ^^^^^^^^^^ | |
| | | |
| note: same as this | |
| --> tests/ui/if_same_then_else.rs:253:30 | |
| | | |
| LL | _ = if x { a == b } else { b == a }; | |
| | ^^^^^^^^^^ | |
| error: this `if` has identical blocks | |
| --> tests/ui/if_same_then_else.rs:255:14 | |
| | | |
| LL | _ = if x { a != b } else { b != a }; | |
| | ^^^^^^^^^^ | |
| | | |
| note: same as this | |
| --> tests/ui/if_same_then_else.rs:255:30 | |
| | | |
| LL | _ = if x { a != b } else { b != a }; | |
| | ^^^^^^^^^^ | |
| error: this `if` has identical blocks | |
| --> tests/ui/if_same_then_else.rs:259:14 | |
| | | |
| LL | _ = if x { a < b } else { b > a }; | |
| | ^^^^^^^^^ | |
| | | |
| note: same as this | |
| --> tests/ui/if_same_then_else.rs:259:29 | |
| | | |
| LL | _ = if x { a < b } else { b > a }; | |
| | ^^^^^^^^^ | |
| error: this `if` has identical blocks | |
| --> tests/ui/if_same_then_else.rs:261:14 | |
| | | |
| LL | _ = if x { a <= b } else { b >= a }; | |
| | ^^^^^^^^^^ | |
| | | |
| note: same as this | |
| --> tests/ui/if_same_then_else.rs:261:30 | |
| | | |
| LL | _ = if x { a <= b } else { b >= a }; | |
| | ^^^^^^^^^^ | |
| error: this `if` has identical blocks | |
| --> tests/ui/if_same_then_else.rs:263:14 | |
| | | |
| LL | _ = if x { a > b } else { b < a }; | |
| | ^^^^^^^^^ | |
| | | |
| note: same as this | |
| --> tests/ui/if_same_then_else.rs:263:29 | |
| | | |
| LL | _ = if x { a > b } else { b < a }; | |
| | ^^^^^^^^^ | |
| error: this `if` has identical blocks | |
| --> tests/ui/if_same_then_else.rs:265:14 | |
| | | |
| LL | _ = if x { a >= b } else { b <= a }; | |
| | ^^^^^^^^^^ | |
| | | |
| note: same as this | |
| --> tests/ui/if_same_then_else.rs:265:30 | |
| | | |
| LL | _ = if x { a >= b } else { b <= a }; | |
| | ^^^^^^^^^^ | |
| error: this `if` has identical blocks | |
| --> tests/ui/if_same_then_else.rs:278:14 | |
| | | |
| LL | _ = if x { a * b } else { b * a }; | |
| | ^^^^^^^^^ | |
| | | |
| note: same as this | |
| --> tests/ui/if_same_then_else.rs:278:29 | |
| | | |
| LL | _ = if x { a * b } else { b * a }; | |
| | ^^^^^^^^^ | |
| error: this `if` has identical blocks | |
| --> tests/ui/if_same_then_else.rs:280:14 | |
| | | |
| LL | _ = if x { a + b } else { b + a }; | |
| | ^^^^^^^^^ | |
| | | |
| note: same as this | |
| --> tests/ui/if_same_then_else.rs:280:29 | |
| | | |
| LL | _ = if x { a + b } else { b + a }; | |
| | ^^^^^^^^^ | |
| error: this `if` has identical blocks | |
| --> tests/ui/if_same_then_else.rs:282:14 | |
| | | |
| LL | _ = if x { a & b } else { b & a }; | |
| | ^^^^^^^^^ | |
| | | |
| note: same as this | |
| --> tests/ui/if_same_then_else.rs:282:29 | |
| | | |
| LL | _ = if x { a & b } else { b & a }; | |
| | ^^^^^^^^^ | |
| error: this `if` has identical blocks | |
| --> tests/ui/if_same_then_else.rs:284:14 | |
| | | |
| LL | _ = if x { a ^ b } else { b ^ a }; | |
| | ^^^^^^^^^ | |
| | | |
| note: same as this | |
| --> tests/ui/if_same_then_else.rs:284:29 | |
| | | |
| LL | _ = if x { a ^ b } else { b ^ a }; | |
| | ^^^^^^^^^ | |
| error: this `if` has identical blocks | |
| --> tests/ui/if_same_then_else.rs:286:14 | |
| | | |
| LL | _ = if x { a | b } else { b | a }; | |
| | ^^^^^^^^^ | |
| | | |
| note: same as this | |
| --> tests/ui/if_same_then_else.rs:286:29 | |
| | | |
| LL | _ = if x { a | b } else { b | a }; | |
| | ^^^^^^^^^ | |
| error: this `if` has identical blocks | |
| --> tests/ui/if_same_then_else.rs:290:14 | |
| | | |
| LL | _ = if x { a == b } else { b == a }; | |
| | ^^^^^^^^^^ | |
| | | |
| note: same as this | |
| --> tests/ui/if_same_then_else.rs:290:30 | |
| | | |
| LL | _ = if x { a == b } else { b == a }; | |
| | ^^^^^^^^^^ | |
| error: this `if` has identical blocks | |
| --> tests/ui/if_same_then_else.rs:292:14 | |
| | | |
| LL | _ = if x { a != b } else { b != a }; | |
| | ^^^^^^^^^^ | |
| | | |
| note: same as this | |
| --> tests/ui/if_same_then_else.rs:292:30 | |
| | | |
| LL | _ = if x { a != b } else { b != a }; | |
| | ^^^^^^^^^^ | |
| error: this `if` has identical blocks | |
| --> tests/ui/if_same_then_else.rs:296:14 | |
| | | |
| LL | _ = if x { a < b } else { b > a }; | |
| | ^^^^^^^^^ | |
| | | |
| note: same as this | |
| --> tests/ui/if_same_then_else.rs:296:29 | |
| | | |
| LL | _ = if x { a < b } else { b > a }; | |
| | ^^^^^^^^^ | |
| error: this `if` has identical blocks | |
| --> tests/ui/if_same_then_else.rs:298:14 | |
| | | |
| LL | _ = if x { a <= b } else { b >= a }; | |
| | ^^^^^^^^^^ | |
| | | |
| note: same as this | |
| --> tests/ui/if_same_then_else.rs:298:30 | |
| | | |
| LL | _ = if x { a <= b } else { b >= a }; | |
| | ^^^^^^^^^^ | |
| error: this `if` has identical blocks | |
| --> tests/ui/if_same_then_else.rs:300:14 | |
| | | |
| LL | _ = if x { a > b } else { b < a }; | |
| | ^^^^^^^^^ | |
| | | |
| note: same as this | |
| --> tests/ui/if_same_then_else.rs:300:29 | |
| | | |
| LL | _ = if x { a > b } else { b < a }; | |
| | ^^^^^^^^^ | |
| error: this `if` has identical blocks | |
| --> tests/ui/if_same_then_else.rs:302:14 | |
| | | |
| LL | _ = if x { a >= b } else { b <= a }; | |
| | ^^^^^^^^^^ | |
| | | |
| note: same as this | |
| --> tests/ui/if_same_then_else.rs:302:30 | |
| | | |
| LL | _ = if x { a >= b } else { b <= a }; | |
| | ^^^^^^^^^^ | |
| error: aborting due to 23 previous errors | |