2021-04-08 15:50:13 +00:00
|
|
|
error: this `if` has identical blocks
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/branches_sharing_code/valid_if_blocks.rs:109:14
|
2021-04-08 15:50:13 +00:00
|
|
|
|
|
|
|
|
LL | if false {
|
|
|
|
| ______________^
|
|
|
|
LL | | } else {
|
|
|
|
| |_____^
|
|
|
|
|
|
|
|
|
note: same as this
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/branches_sharing_code/valid_if_blocks.rs:110:12
|
2021-04-08 15:50:13 +00:00
|
|
|
|
|
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
2022-09-22 16:04:22 +00:00
|
|
|
note: the lint level is defined here
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/branches_sharing_code/valid_if_blocks.rs:1:40
|
2022-09-22 16:04:22 +00:00
|
|
|
|
|
2022-10-06 07:19:29 +00:00
|
|
|
LL | #![deny(clippy::branches_sharing_code, clippy::if_same_then_else)]
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
2021-04-08 15:50:13 +00:00
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/branches_sharing_code/valid_if_blocks.rs:121:15
|
2021-04-08 15:50:13 +00:00
|
|
|
|
|
|
|
|
LL | if x == 0 {
|
|
|
|
| _______________^
|
|
|
|
LL | | let u = 19;
|
|
|
|
LL | | println!("How are u today?");
|
|
|
|
LL | | let _ = "This is a string";
|
|
|
|
LL | | } else {
|
|
|
|
| |_____^
|
|
|
|
|
|
|
|
|
note: same as this
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/branches_sharing_code/valid_if_blocks.rs:125:12
|
2021-04-08 15:50:13 +00:00
|
|
|
|
|
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
|
|
|
LL | | let u = 19;
|
|
|
|
LL | | println!("How are u today?");
|
|
|
|
LL | | let _ = "This is a string";
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/branches_sharing_code/valid_if_blocks.rs:133:23
|
2021-04-08 15:50:13 +00:00
|
|
|
|
|
|
|
|
LL | let _ = if x == 6 { 7 } else { 7 };
|
|
|
|
| ^^^^^
|
|
|
|
|
|
|
|
|
note: same as this
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/branches_sharing_code/valid_if_blocks.rs:133:34
|
2021-04-08 15:50:13 +00:00
|
|
|
|
|
|
|
|
LL | let _ = if x == 6 { 7 } else { 7 };
|
|
|
|
| ^^^^^
|
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/branches_sharing_code/valid_if_blocks.rs:140:23
|
2021-04-08 15:50:13 +00:00
|
|
|
|
|
|
|
|
LL | } else if x == 68 {
|
|
|
|
| _______________________^
|
|
|
|
LL | | println!("I'm a doppelgänger");
|
|
|
|
LL | |
|
|
|
|
LL | | if y == 90 { "=^.^=" } else { ":D" }
|
|
|
|
LL | | } else {
|
|
|
|
| |_____^
|
|
|
|
|
|
|
|
|
note: same as this
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/branches_sharing_code/valid_if_blocks.rs:144:12
|
2021-04-08 15:50:13 +00:00
|
|
|
|
|
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
|
|
|
LL | | println!("I'm a doppelgänger");
|
|
|
|
LL | |
|
|
|
|
LL | | if y == 90 { "=^.^=" } else { ":D" }
|
|
|
|
LL | | };
|
|
|
|
| |_____^
|
|
|
|
|
|
|
|
error: this `if` has identical blocks
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/branches_sharing_code/valid_if_blocks.rs:153:23
|
2021-04-08 15:50:13 +00:00
|
|
|
|
|
|
|
|
LL | } else if x == 68 {
|
|
|
|
| _______________________^
|
|
|
|
LL | | println!("I'm a doppelgänger");
|
|
|
|
LL | | } else {
|
|
|
|
| |_____^
|
|
|
|
|
|
|
|
|
note: same as this
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/branches_sharing_code/valid_if_blocks.rs:155:12
|
2021-04-08 15:50:13 +00:00
|
|
|
|
|
|
|
|
LL | } else {
|
|
|
|
| ____________^
|
|
|
|
LL | | println!("I'm a doppelgänger");
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
|
|
|
|
|
|
|
error: aborting due to 5 previous errors
|
|
|
|
|