1
1
error: this `if` has identical blocks
2
- --> $DIR/valid_if_blocks.rs:110:15
2
+ --> $DIR/valid_if_blocks.rs:104:14
3
3
|
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
+ | ______________^
9
6
LL | | } else {
10
7
| |_____^
11
8
|
@@ -15,7 +12,26 @@ note: the lint level is defined here
15
12
LL | #![deny(clippy::if_same_then_else, clippy::shared_code_in_if_blocks)]
16
13
| ^^^^^^^^^^^^^^^^^^^^^^^^^
17
14
note: 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
19
35
|
20
36
LL | } else {
21
37
| ____________^
@@ -26,45 +42,43 @@ LL | | }
26
42
| |_____^
27
43
28
44
error: this `if` has identical blocks
29
- --> $DIR/valid_if_blocks.rs:121 :23
45
+ --> $DIR/valid_if_blocks.rs:126 :23
30
46
|
31
47
LL | let _ = if x == 6 { 7 } else { 7 };
32
48
| ^^^^^
33
49
|
34
50
note: same as this
35
- --> $DIR/valid_if_blocks.rs:121 :34
51
+ --> $DIR/valid_if_blocks.rs:126 :34
36
52
|
37
53
LL | let _ = if x == 6 { 7 } else { 7 };
38
54
| ^^^^^
39
55
40
56
error: this `if` has identical blocks
41
- --> $DIR/valid_if_blocks.rs:127 :23
57
+ --> $DIR/valid_if_blocks.rs:132 :23
42
58
|
43
59
LL | } else if x == 68 {
44
60
| _______________________^
45
61
LL | | println!("I'm a doppelgänger");
46
62
LL | | // Don't listen to my clone below
47
63
LL | |
48
- ... |
49
- LL | | }
64
+ LL | | if y == 90 { "=^.^=" } else { ":D" }
50
65
LL | | } else {
51
66
| |_____^
52
67
|
53
68
note: same as this
54
- --> $DIR/valid_if_blocks.rs:136 :12
69
+ --> $DIR/valid_if_blocks.rs:137 :12
55
70
|
56
71
LL | } else {
57
72
| ____________^
58
73
LL | | // Don't listen to my clone above
59
74
LL | | println!("I'm a doppelgänger");
60
75
LL | |
61
- ... |
62
- LL | | }
76
+ LL | | if y == 90 { "=^.^=" } else { ":D" }
63
77
LL | | };
64
78
| |_____^
65
79
66
80
error: this `if` has identical blocks
67
- --> $DIR/valid_if_blocks.rs:149 :23
81
+ --> $DIR/valid_if_blocks.rs:146 :23
68
82
|
69
83
LL | } else if x == 68 {
70
84
| _______________________^
@@ -74,7 +88,7 @@ LL | | } else {
74
88
| |_____^
75
89
|
76
90
note: same as this
77
- --> $DIR/valid_if_blocks.rs:152 :12
91
+ --> $DIR/valid_if_blocks.rs:149 :12
78
92
|
79
93
LL | } else {
80
94
| ____________^
@@ -83,5 +97,5 @@ LL | | println!("I'm a doppelgänger");
83
97
LL | | }
84
98
| |_____^
85
99
86
- error: aborting due to 4 previous errors
100
+ error: aborting due to 5 previous errors
87
101
0 commit comments