1
1
error: this `if` has identical blocks
2
- --> $DIR/if_same_then_else.rs:31 :12
2
+ --> $DIR/if_same_then_else.rs:28 :12
3
3
|
4
4
LL | } else {
5
5
| ____________^
@@ -13,7 +13,7 @@ LL | | }
13
13
|
14
14
= note: `-D clippy::if-same-then-else` implied by `-D warnings`
15
15
note: same as this
16
- --> $DIR/if_same_then_else.rs:23 :13
16
+ --> $DIR/if_same_then_else.rs:20 :13
17
17
|
18
18
LL | if true {
19
19
| _____________^
@@ -26,7 +26,7 @@ LL | | } else {
26
26
| |_____^
27
27
28
28
error: this `if` has identical blocks
29
- --> $DIR/if_same_then_else.rs:69 :12
29
+ --> $DIR/if_same_then_else.rs:66 :12
30
30
|
31
31
LL | } else {
32
32
| ____________^
@@ -36,7 +36,7 @@ LL | | };
36
36
| |_____^
37
37
|
38
38
note: same as this
39
- --> $DIR/if_same_then_else.rs:67 :21
39
+ --> $DIR/if_same_then_else.rs:64 :21
40
40
|
41
41
LL | let _ = if true {
42
42
| _____________________^
@@ -45,7 +45,7 @@ LL | | } else {
45
45
| |_____^
46
46
47
47
error: this `if` has identical blocks
48
- --> $DIR/if_same_then_else.rs:76 :12
48
+ --> $DIR/if_same_then_else.rs:73 :12
49
49
|
50
50
LL | } else {
51
51
| ____________^
@@ -55,7 +55,7 @@ LL | | };
55
55
| |_____^
56
56
|
57
57
note: same as this
58
- --> $DIR/if_same_then_else.rs:74 :21
58
+ --> $DIR/if_same_then_else.rs:71 :21
59
59
|
60
60
LL | let _ = if true {
61
61
| _____________________^
@@ -64,7 +64,7 @@ LL | | } else {
64
64
| |_____^
65
65
66
66
error: this `if` has identical blocks
67
- --> $DIR/if_same_then_else.rs:92 :12
67
+ --> $DIR/if_same_then_else.rs:89 :12
68
68
|
69
69
LL | } else {
70
70
| ____________^
@@ -74,7 +74,7 @@ LL | | };
74
74
| |_____^
75
75
|
76
76
note: same as this
77
- --> $DIR/if_same_then_else.rs:90 :21
77
+ --> $DIR/if_same_then_else.rs:87 :21
78
78
|
79
79
LL | let _ = if true {
80
80
| _____________________^
@@ -83,33 +83,7 @@ LL | | } else {
83
83
| |_____^
84
84
85
85
error: this `if` has identical blocks
86
- --> $DIR/if_same_then_else.rs:106:12
87
- |
88
- LL | } else {
89
- | ____________^
90
- LL | | //~ ERROR same body as `if` block
91
- LL | | for _ in &[42] {
92
- LL | | let foo: &Option<_> = &Some::<u8>(42);
93
- ... |
94
- LL | | }
95
- LL | | }
96
- | |_____^
97
- |
98
- note: same as this
99
- --> $DIR/if_same_then_else.rs:97:13
100
- |
101
- LL | if true {
102
- | _____________^
103
- LL | | for _ in &[42] {
104
- LL | | let foo: &Option<_> = &Some::<u8>(42);
105
- LL | | if true {
106
- ... |
107
- LL | | }
108
- LL | | } else {
109
- | |_____^
110
-
111
- error: this `if` has identical blocks
112
- --> $DIR/if_same_then_else.rs:125:12
86
+ --> $DIR/if_same_then_else.rs:101:12
113
87
|
114
88
LL | } else {
115
89
| ____________^
@@ -122,7 +96,7 @@ LL | | }
122
96
| |_____^
123
97
|
124
98
note: same as this
125
- --> $DIR/if_same_then_else.rs:118 :13
99
+ --> $DIR/if_same_then_else.rs:94 :13
126
100
|
127
101
LL | if true {
128
102
| _____________^
@@ -134,114 +108,5 @@ LL | | bar + 1;
134
108
LL | | } else {
135
109
| |_____^
136
110
137
- error: this `if` has identical blocks
138
- --> $DIR/if_same_then_else.rs:155:12
139
- |
140
- LL | } else {
141
- | ____________^
142
- LL | | //~ ERROR same body as `if` block
143
- LL | | if let Some(a) = Some(42) {}
144
- LL | | }
145
- | |_____^
146
- |
147
- note: same as this
148
- --> $DIR/if_same_then_else.rs:153:13
149
- |
150
- LL | if true {
151
- | _____________^
152
- LL | | if let Some(a) = Some(42) {}
153
- LL | | } else {
154
- | |_____^
155
-
156
- error: this `if` has identical blocks
157
- --> $DIR/if_same_then_else.rs:162:12
158
- |
159
- LL | } else {
160
- | ____________^
161
- LL | | //~ ERROR same body as `if` block
162
- LL | | if let (1, .., 3) = (1, 2, 3) {}
163
- LL | | }
164
- | |_____^
165
- |
166
- note: same as this
167
- --> $DIR/if_same_then_else.rs:160:13
168
- |
169
- LL | if true {
170
- | _____________^
171
- LL | | if let (1, .., 3) = (1, 2, 3) {}
172
- LL | | } else {
173
- | |_____^
174
-
175
- error: this `if` has identical blocks
176
- --> $DIR/if_same_then_else.rs:212:12
177
- |
178
- LL | } else {
179
- | ____________^
180
- LL | | //~ ERROR same body as `if` block
181
- LL | | std::f32::NAN
182
- LL | | };
183
- | |_____^
184
- |
185
- note: same as this
186
- --> $DIR/if_same_then_else.rs:210:21
187
- |
188
- LL | let _ = if true {
189
- | _____________________^
190
- LL | | std::f32::NAN
191
- LL | | } else {
192
- | |_____^
193
-
194
- error: this `if` has identical blocks
195
- --> $DIR/if_same_then_else.rs:219:12
196
- |
197
- LL | } else {
198
- | ____________^
199
- LL | | //~ ERROR same body as `if` block
200
- LL | | Ok("foo")?;
201
- LL | | }
202
- | |_____^
203
- |
204
- note: same as this
205
- --> $DIR/if_same_then_else.rs:217:13
206
- |
207
- LL | if true {
208
- | _____________^
209
- LL | | Ok("foo")?;
210
- LL | | } else {
211
- | |_____^
212
-
213
- error: this `if` has identical blocks
214
- --> $DIR/if_same_then_else.rs:244:12
215
- |
216
- LL | } else {
217
- | ____________^
218
- LL | | let foo = "";
219
- LL | | return Ok(&foo[0..]);
220
- LL | | }
221
- | |_____^
222
- |
223
- note: same as this
224
- --> $DIR/if_same_then_else.rs:241:20
225
- |
226
- LL | } else if true {
227
- | ____________________^
228
- LL | | let foo = "";
229
- LL | | return Ok(&foo[0..]);
230
- LL | | } else {
231
- | |_____^
232
-
233
- error: this `if` has the same condition as a previous `if`
234
- --> $DIR/if_same_then_else.rs:241:15
235
- |
236
- LL | } else if true {
237
- | ^^^^
238
- |
239
- = note: `#[deny(clippy::ifs_same_cond)]` on by default
240
- note: same as this
241
- --> $DIR/if_same_then_else.rs:235:8
242
- |
243
- LL | if true {
244
- | ^^^^
245
-
246
- error: aborting due to 12 previous errors
111
+ error: aborting due to 5 previous errors
247
112
0 commit comments