2020-01-19 00:04:41 -06:00
|
|
|
error: this `if` has identical blocks
|
2023-06-10 06:43:30 -05:00
|
|
|
--> $DIR/if_same_then_else2.rs:15:13
|
2020-01-19 00:04:41 -06:00
|
|
|
|
|
|
|
|
LL | if true {
|
|
|
|
| _____________^
|
2023-04-20 10:19:36 -05:00
|
|
|
LL | |
|
2020-01-19 00:04:41 -06:00
|
|
|
LL | | for _ in &[42] {
|
|
|
|
LL | | let foo: &Option<_> = &Some::<u8>(42);
|
|
|
|
... |
|
|
|
|
LL | | }
|
|
|
|
LL | | } else {
|
|
|
|
| |_____^
|
2021-04-08 10:50:13 -05:00
|
|
|
|
|
|
|
|
note: same as this
|
2023-04-20 10:19:36 -05:00
|
|
|
--> $DIR/if_same_then_else2.rs:25:12
|
2020-01-19 00:04:41 -06:00
|
|
|
|
|
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
2021-04-08 10:50:13 -05:00
|
|
|
LL | | for _ in &[42] {
|
|
|
|
LL | | let bar: &Option<_> = &Some::<u8>(42);
|
2023-04-20 10:19:36 -05:00
|
|
|
LL | | if bar.is_some() {
|
2021-04-08 10:50:13 -05:00
|
|
|
... |
|
|
|
|
LL | | }
|
2020-01-19 00:04:41 -06:00
|
|
|
LL | | }
|
|
|
|
| |_____^
|
2022-09-22 11:04:22 -05:00
|
|
|
= note: `-D clippy::if-same-then-else` implied by `-D warnings`
|
2021-04-08 10:50:13 -05:00
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
2023-06-10 06:43:30 -05:00
|
|
|
--> $DIR/if_same_then_else2.rs:36:13
|
2020-01-19 00:04:41 -06:00
|
|
|
|
|
|
|
|
LL | if true {
|
|
|
|
| _____________^
|
2023-04-20 10:19:36 -05:00
|
|
|
LL | |
|
2020-01-19 00:04:41 -06:00
|
|
|
LL | | if let Some(a) = Some(42) {}
|
|
|
|
LL | | } else {
|
|
|
|
| |_____^
|
2021-04-08 10:50:13 -05:00
|
|
|
|
|
|
|
|
note: same as this
|
2023-04-20 10:19:36 -05:00
|
|
|
--> $DIR/if_same_then_else2.rs:39:12
|
2020-01-19 00:04:41 -06:00
|
|
|
|
|
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
2021-04-08 10:50:13 -05:00
|
|
|
LL | | if let Some(a) = Some(42) {}
|
2020-01-19 00:04:41 -06:00
|
|
|
LL | | }
|
|
|
|
| |_____^
|
2021-04-08 10:50:13 -05:00
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
2023-06-10 06:43:30 -05:00
|
|
|
--> $DIR/if_same_then_else2.rs:43:13
|
2020-01-19 00:04:41 -06:00
|
|
|
|
|
|
|
|
LL | if true {
|
|
|
|
| _____________^
|
2023-04-20 10:19:36 -05:00
|
|
|
LL | |
|
2020-01-19 00:04:41 -06:00
|
|
|
LL | | if let (1, .., 3) = (1, 2, 3) {}
|
|
|
|
LL | | } else {
|
|
|
|
| |_____^
|
2021-04-08 10:50:13 -05:00
|
|
|
|
|
|
|
|
note: same as this
|
2023-04-20 10:19:36 -05:00
|
|
|
--> $DIR/if_same_then_else2.rs:46:12
|
2020-01-19 00:04:41 -06:00
|
|
|
|
|
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
2021-04-08 10:50:13 -05:00
|
|
|
LL | | if let (1, .., 3) = (1, 2, 3) {}
|
|
|
|
LL | | }
|
2020-01-19 00:04:41 -06:00
|
|
|
| |_____^
|
2021-04-08 10:50:13 -05:00
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
2023-06-10 06:43:30 -05:00
|
|
|
--> $DIR/if_same_then_else2.rs:93:21
|
2020-01-19 00:04:41 -06:00
|
|
|
|
|
|
|
|
LL | let _ = if true {
|
|
|
|
| _____________________^
|
2023-04-20 10:19:36 -05:00
|
|
|
LL | |
|
2020-04-07 17:04:33 -05:00
|
|
|
LL | | f32::NAN
|
2020-01-19 00:04:41 -06:00
|
|
|
LL | | } else {
|
|
|
|
| |_____^
|
2021-04-08 10:50:13 -05:00
|
|
|
|
|
|
|
|
note: same as this
|
2023-04-20 10:19:36 -05:00
|
|
|
--> $DIR/if_same_then_else2.rs:96:12
|
2020-01-19 00:04:41 -06:00
|
|
|
|
|
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
2021-04-08 10:50:13 -05:00
|
|
|
LL | | f32::NAN
|
|
|
|
LL | | };
|
2020-01-19 00:04:41 -06:00
|
|
|
| |_____^
|
2021-04-08 10:50:13 -05:00
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
2023-06-10 06:43:30 -05:00
|
|
|
--> $DIR/if_same_then_else2.rs:100:13
|
2020-01-19 00:04:41 -06:00
|
|
|
|
|
|
|
|
LL | if true {
|
|
|
|
| _____________^
|
2023-04-20 10:19:36 -05:00
|
|
|
LL | |
|
2020-01-19 00:04:41 -06:00
|
|
|
LL | | Ok("foo")?;
|
|
|
|
LL | | } else {
|
|
|
|
| |_____^
|
2021-04-08 10:50:13 -05:00
|
|
|
|
|
|
|
|
note: same as this
|
2023-04-20 10:19:36 -05:00
|
|
|
--> $DIR/if_same_then_else2.rs:103:12
|
2020-01-19 00:04:41 -06:00
|
|
|
|
|
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
2021-04-08 10:50:13 -05:00
|
|
|
LL | | Ok("foo")?;
|
2020-01-19 00:04:41 -06:00
|
|
|
LL | | }
|
|
|
|
| |_____^
|
2021-04-08 10:50:13 -05:00
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
2023-06-10 06:43:30 -05:00
|
|
|
--> $DIR/if_same_then_else2.rs:124:20
|
2020-01-19 00:04:41 -06:00
|
|
|
|
|
|
|
|
LL | } else if true {
|
|
|
|
| ____________________^
|
2023-04-20 10:19:36 -05:00
|
|
|
LL | |
|
2020-01-19 00:04:41 -06:00
|
|
|
LL | | let foo = "";
|
|
|
|
LL | | return Ok(&foo[0..]);
|
|
|
|
LL | | } else {
|
|
|
|
| |_____^
|
2021-04-08 10:50:13 -05:00
|
|
|
|
|
|
|
|
note: same as this
|
2023-04-20 10:19:36 -05:00
|
|
|
--> $DIR/if_same_then_else2.rs:128:12
|
2021-04-08 10:50:13 -05:00
|
|
|
|
|
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
|
|
|
LL | | let foo = "";
|
|
|
|
LL | | return Ok(&foo[0..]);
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
2020-01-19 00:04:41 -06:00
|
|
|
|
|
|
|
error: aborting due to 6 previous errors
|
|
|
|
|