| error: this `if` has identical blocks | |
| --> tests/ui/if_same_then_else2.rs:5:13 | |
| | | |
| LL | if true { | |
| | _____________^ | |
| LL | | for _ in &[42] { | |
| LL | | let foo: &Option<_> = &Some::<u8>(42); | |
| LL | | if foo.is_some() { | |
| ... | | |
| LL | | } else { | |
| | |_____^ | |
| | | |
| note: same as this | |
| --> tests/ui/if_same_then_else2.rs:14:12 | |
| | | |
| LL | } else { | |
| | ____________^ | |
| LL | | for _ in &[42] { | |
| LL | | let bar: &Option<_> = &Some::<u8>(42); | |
| LL | | if bar.is_some() { | |
| ... | | |
| 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_else2.rs:26:13 | |
| | | |
| LL | if true { | |
| | _____________^ | |
| LL | | if let Some(a) = Some(42) {} | |
| LL | | } else { | |
| | |_____^ | |
| | | |
| note: same as this | |
| --> tests/ui/if_same_then_else2.rs:28:12 | |
| | | |
| LL | } else { | |
| | ____________^ | |
| LL | | if let Some(a) = Some(42) {} | |
| LL | | } | |
| | |_____^ | |
| error: this `if` has identical blocks | |
| --> tests/ui/if_same_then_else2.rs:33:13 | |
| | | |
| LL | if true { | |
| | _____________^ | |
| LL | | if let (1, .., 3) = (1, 2, 3) {} | |
| LL | | } else { | |
| | |_____^ | |
| | | |
| note: same as this | |
| --> tests/ui/if_same_then_else2.rs:35:12 | |
| | | |
| LL | } else { | |
| | ____________^ | |
| LL | | if let (1, .., 3) = (1, 2, 3) {} | |
| LL | | } | |
| | |_____^ | |
| error: this `if` has identical blocks | |
| --> tests/ui/if_same_then_else2.rs:83:21 | |
| | | |
| LL | let _ = if true { f32::NAN } else { f32::NAN }; | |
| | ^^^^^^^^^^^^ | |
| | | |
| note: same as this | |
| --> tests/ui/if_same_then_else2.rs:83:39 | |
| | | |
| LL | let _ = if true { f32::NAN } else { f32::NAN }; | |
| | ^^^^^^^^^^^^ | |
| error: this `if` has identical blocks | |
| --> tests/ui/if_same_then_else2.rs:86:13 | |
| | | |
| LL | if true { | |
| | _____________^ | |
| LL | | Ok("foo")?; | |
| LL | | } else { | |
| | |_____^ | |
| | | |
| note: same as this | |
| --> tests/ui/if_same_then_else2.rs:88:12 | |
| | | |
| LL | } else { | |
| | ____________^ | |
| LL | | Ok("foo")?; | |
| LL | | } | |
| | |_____^ | |
| error: this `if` has identical blocks | |
| --> tests/ui/if_same_then_else2.rs:110:20 | |
| | | |
| LL | } else if true { | |
| | ____________________^ | |
| LL | | let foo = ""; | |
| LL | | return Ok(&foo[0..]); | |
| LL | | } else { | |
| | |_____^ | |
| | | |
| note: same as this | |
| --> tests/ui/if_same_then_else2.rs:113:12 | |
| | | |
| LL | } else { | |
| | ____________^ | |
| LL | | let foo = ""; | |
| LL | | return Ok(&foo[0..]); | |
| LL | | } | |
| | |_____^ | |
| error: aborting due to 6 previous errors | |