11error: this `if` has identical blocks
2- --> $DIR/valid_if_blocks.rs:110:15
2+ --> $DIR/valid_if_blocks.rs:104:14
33 |
4- LL | if x == 0 {
5- | _______________^
6- LL | | let u = 19;
7- LL | | println!("How are u today?");
8- LL | | let _ = "This is a string";
4+ LL | if false {
5+ | ______________^
96LL | | } else {
107 | |_____^
118 |
@@ -15,7 +12,26 @@ note: the lint level is defined here
1512LL | #![deny(clippy::if_same_then_else, clippy::shared_code_in_if_blocks)]
1613 | ^^^^^^^^^^^^^^^^^^^^^^^^^
1714note: same as this
18- --> $DIR/valid_if_blocks.rs:114:12
15+ --> $DIR/valid_if_blocks.rs:105:12
16+ |
17+ LL | } else {
18+ | ____________^
19+ LL | | }
20+ | |_____^
21+
22+ error: this `if` has identical blocks
23+ --> $DIR/valid_if_blocks.rs:115:15
24+ |
25+ LL | if x == 0 {
26+ | _______________^
27+ LL | | let u = 19;
28+ LL | | println!("How are u today?");
29+ LL | | let _ = "This is a string";
30+ LL | | } else {
31+ | |_____^
32+ |
33+ note: same as this
34+ --> $DIR/valid_if_blocks.rs:119:12
1935 |
2036LL | } else {
2137 | ____________^
@@ -26,45 +42,43 @@ LL | | }
2642 | |_____^
2743
2844error: this `if` has identical blocks
29- --> $DIR/valid_if_blocks.rs:121 :23
45+ --> $DIR/valid_if_blocks.rs:126 :23
3046 |
3147LL | let _ = if x == 6 { 7 } else { 7 };
3248 | ^^^^^
3349 |
3450note: same as this
35- --> $DIR/valid_if_blocks.rs:121 :34
51+ --> $DIR/valid_if_blocks.rs:126 :34
3652 |
3753LL | let _ = if x == 6 { 7 } else { 7 };
3854 | ^^^^^
3955
4056error: this `if` has identical blocks
41- --> $DIR/valid_if_blocks.rs:127 :23
57+ --> $DIR/valid_if_blocks.rs:132 :23
4258 |
4359LL | } else if x == 68 {
4460 | _______________________^
4561LL | | println!("I'm a doppelgänger");
4662LL | | // Don't listen to my clone below
4763LL | |
48- ... |
49- LL | | }
64+ LL | | if y == 90 { "=^.^=" } else { ":D" }
5065LL | | } else {
5166 | |_____^
5267 |
5368note: same as this
54- --> $DIR/valid_if_blocks.rs:136 :12
69+ --> $DIR/valid_if_blocks.rs:137 :12
5570 |
5671LL | } else {
5772 | ____________^
5873LL | | // Don't listen to my clone above
5974LL | | println!("I'm a doppelgänger");
6075LL | |
61- ... |
62- LL | | }
76+ LL | | if y == 90 { "=^.^=" } else { ":D" }
6377LL | | };
6478 | |_____^
6579
6680error: this `if` has identical blocks
67- --> $DIR/valid_if_blocks.rs:149 :23
81+ --> $DIR/valid_if_blocks.rs:146 :23
6882 |
6983LL | } else if x == 68 {
7084 | _______________________^
@@ -74,7 +88,7 @@ LL | | } else {
7488 | |_____^
7589 |
7690note: same as this
77- --> $DIR/valid_if_blocks.rs:152 :12
91+ --> $DIR/valid_if_blocks.rs:149 :12
7892 |
7993LL | } else {
8094 | ____________^
@@ -83,5 +97,5 @@ LL | | println!("I'm a doppelgänger");
8397LL | | }
8498 | |_____^
8599
86- error: aborting due to 4 previous errors
100+ error: aborting due to 5 previous errors
87101
0 commit comments