2020-01-19 06:04:41 +00:00
|
|
|
error: this `if` has identical blocks
|
2023-07-02 12:35:19 +00:00
|
|
|
--> $DIR/if_same_then_else2.rs:15:13
|
2020-01-19 06:04:41 +00:00
|
|
|
|
|
|
|
|
LL | if true {
|
|
|
|
| _____________^
|
|
|
|
LL | | for _ in &[42] {
|
|
|
|
LL | | let foo: &Option<_> = &Some::<u8>(42);
|
2024-01-02 06:00:20 +00:00
|
|
|
LL | | if foo.is_some() {
|
2020-01-19 06:04:41 +00:00
|
|
|
... |
|
|
|
|
LL | | }
|
|
|
|
LL | | } else {
|
|
|
|
| |_____^
|
2021-04-08 15:50:13 +00:00
|
|
|
|
|
|
|
|
note: same as this
|
2024-01-02 06:00:20 +00:00
|
|
|
--> $DIR/if_same_then_else2.rs:24:12
|
2020-01-19 06:04:41 +00:00
|
|
|
|
|
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
2021-04-08 15:50:13 +00:00
|
|
|
LL | | for _ in &[42] {
|
|
|
|
LL | | let bar: &Option<_> = &Some::<u8>(42);
|
2023-07-02 12:35:19 +00:00
|
|
|
LL | | if bar.is_some() {
|
2021-04-08 15:50:13 +00:00
|
|
|
... |
|
|
|
|
LL | | }
|
2020-01-19 06:04:41 +00:00
|
|
|
LL | | }
|
|
|
|
| |_____^
|
2022-09-22 16:04:22 +00:00
|
|
|
= note: `-D clippy::if-same-then-else` implied by `-D warnings`
|
2023-08-01 12:02:21 +00:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::if_same_then_else)]`
|
2021-04-08 15:50:13 +00:00
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
2023-07-02 12:35:19 +00:00
|
|
|
--> $DIR/if_same_then_else2.rs:36:13
|
2020-01-19 06:04:41 +00:00
|
|
|
|
|
|
|
|
LL | if true {
|
|
|
|
| _____________^
|
|
|
|
LL | | if let Some(a) = Some(42) {}
|
|
|
|
LL | | } else {
|
|
|
|
| |_____^
|
2021-04-08 15:50:13 +00:00
|
|
|
|
|
|
|
|
note: same as this
|
2024-01-02 06:00:20 +00:00
|
|
|
--> $DIR/if_same_then_else2.rs:38:12
|
2020-01-19 06:04:41 +00:00
|
|
|
|
|
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
2021-04-08 15:50:13 +00:00
|
|
|
LL | | if let Some(a) = Some(42) {}
|
2020-01-19 06:04:41 +00:00
|
|
|
LL | | }
|
|
|
|
| |_____^
|
2021-04-08 15:50:13 +00:00
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
2023-07-02 12:35:19 +00:00
|
|
|
--> $DIR/if_same_then_else2.rs:43:13
|
2020-01-19 06:04:41 +00:00
|
|
|
|
|
|
|
|
LL | if true {
|
|
|
|
| _____________^
|
|
|
|
LL | | if let (1, .., 3) = (1, 2, 3) {}
|
|
|
|
LL | | } else {
|
|
|
|
| |_____^
|
2021-04-08 15:50:13 +00:00
|
|
|
|
|
|
|
|
note: same as this
|
2024-01-02 06:00:20 +00:00
|
|
|
--> $DIR/if_same_then_else2.rs:45:12
|
2020-01-19 06:04:41 +00:00
|
|
|
|
|
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
2021-04-08 15:50:13 +00:00
|
|
|
LL | | if let (1, .., 3) = (1, 2, 3) {}
|
|
|
|
LL | | }
|
2020-01-19 06:04:41 +00:00
|
|
|
| |_____^
|
2021-04-08 15:50:13 +00:00
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
2023-07-02 12:35:19 +00:00
|
|
|
--> $DIR/if_same_then_else2.rs:93:21
|
2020-01-19 06:04:41 +00:00
|
|
|
|
|
2024-01-02 06:00:20 +00:00
|
|
|
LL | let _ = if true { f32::NAN } else { f32::NAN };
|
|
|
|
| ^^^^^^^^^^^^
|
2021-04-08 15:50:13 +00:00
|
|
|
|
|
|
|
|
note: same as this
|
2024-01-02 06:00:20 +00:00
|
|
|
--> $DIR/if_same_then_else2.rs:93:39
|
2020-01-19 06:04:41 +00:00
|
|
|
|
|
2024-01-02 06:00:20 +00:00
|
|
|
LL | let _ = if true { f32::NAN } else { f32::NAN };
|
|
|
|
| ^^^^^^^^^^^^
|
2021-04-08 15:50:13 +00:00
|
|
|
|
2023-08-23 00:58:09 +00:00
|
|
|
error: this `if` has identical blocks
|
2024-01-02 06:00:20 +00:00
|
|
|
--> $DIR/if_same_then_else2.rs:96:13
|
2023-08-23 00:58:09 +00:00
|
|
|
|
|
|
|
|
LL | if true {
|
|
|
|
| _____________^
|
|
|
|
LL | | Ok("foo")?;
|
|
|
|
LL | | } else {
|
|
|
|
| |_____^
|
|
|
|
|
|
|
|
|
note: same as this
|
2024-01-02 06:00:20 +00:00
|
|
|
--> $DIR/if_same_then_else2.rs:98:12
|
2023-08-23 00:58:09 +00:00
|
|
|
|
|
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
|
|
|
LL | | Ok("foo")?;
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
2021-04-08 15:50:13 +00:00
|
|
|
error: this `if` has identical blocks
|
2024-01-02 06:00:20 +00:00
|
|
|
--> $DIR/if_same_then_else2.rs:120:20
|
2020-01-19 06:04:41 +00:00
|
|
|
|
|
|
|
|
LL | } else if true {
|
|
|
|
| ____________________^
|
|
|
|
LL | | let foo = "";
|
|
|
|
LL | | return Ok(&foo[0..]);
|
|
|
|
LL | | } else {
|
|
|
|
| |_____^
|
2021-04-08 15:50:13 +00:00
|
|
|
|
|
|
|
|
note: same as this
|
2024-01-02 06:00:20 +00:00
|
|
|
--> $DIR/if_same_then_else2.rs:123:12
|
2021-04-08 15:50:13 +00:00
|
|
|
|
|
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
|
|
|
LL | | let foo = "";
|
|
|
|
LL | | return Ok(&foo[0..]);
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
2020-01-19 06:04:41 +00:00
|
|
|
|
2023-08-23 00:58:09 +00:00
|
|
|
error: aborting due to 6 previous errors
|
2020-01-19 06:04:41 +00:00
|
|
|
|