11error: this `if` has identical blocks
2- --> $DIR/if_same_then_else.rs:31 :12
2+ --> $DIR/if_same_then_else.rs:28 :12
33 |
44LL | } else {
55 | ____________^
@@ -13,7 +13,7 @@ LL | | }
1313 |
1414 = note: `-D clippy::if-same-then-else` implied by `-D warnings`
1515note: same as this
16- --> $DIR/if_same_then_else.rs:23 :13
16+ --> $DIR/if_same_then_else.rs:20 :13
1717 |
1818LL | if true {
1919 | _____________^
@@ -26,7 +26,7 @@ LL | | } else {
2626 | |_____^
2727
2828error: this `if` has identical blocks
29- --> $DIR/if_same_then_else.rs:69 :12
29+ --> $DIR/if_same_then_else.rs:66 :12
3030 |
3131LL | } else {
3232 | ____________^
@@ -36,7 +36,7 @@ LL | | };
3636 | |_____^
3737 |
3838note: same as this
39- --> $DIR/if_same_then_else.rs:67 :21
39+ --> $DIR/if_same_then_else.rs:64 :21
4040 |
4141LL | let _ = if true {
4242 | _____________________^
@@ -45,7 +45,7 @@ LL | | } else {
4545 | |_____^
4646
4747error: this `if` has identical blocks
48- --> $DIR/if_same_then_else.rs:76 :12
48+ --> $DIR/if_same_then_else.rs:73 :12
4949 |
5050LL | } else {
5151 | ____________^
@@ -55,7 +55,7 @@ LL | | };
5555 | |_____^
5656 |
5757note: same as this
58- --> $DIR/if_same_then_else.rs:74 :21
58+ --> $DIR/if_same_then_else.rs:71 :21
5959 |
6060LL | let _ = if true {
6161 | _____________________^
@@ -64,7 +64,7 @@ LL | | } else {
6464 | |_____^
6565
6666error: this `if` has identical blocks
67- --> $DIR/if_same_then_else.rs:92 :12
67+ --> $DIR/if_same_then_else.rs:89 :12
6868 |
6969LL | } else {
7070 | ____________^
@@ -74,7 +74,7 @@ LL | | };
7474 | |_____^
7575 |
7676note: same as this
77- --> $DIR/if_same_then_else.rs:90 :21
77+ --> $DIR/if_same_then_else.rs:87 :21
7878 |
7979LL | let _ = if true {
8080 | _____________________^
@@ -83,33 +83,7 @@ LL | | } else {
8383 | |_____^
8484
8585error: 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
11387 |
11488LL | } else {
11589 | ____________^
@@ -122,7 +96,7 @@ LL | | }
12296 | |_____^
12397 |
12498note: same as this
125- --> $DIR/if_same_then_else.rs:118 :13
99+ --> $DIR/if_same_then_else.rs:94 :13
126100 |
127101LL | if true {
128102 | _____________^
@@ -134,114 +108,5 @@ LL | | bar + 1;
134108LL | | } else {
135109 | |_____^
136110
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
247112
0 commit comments