Skip to content

Commit cb2be56

Browse files
tests: if_same_then_else2: Ignore single_element_loop lint
Signed-off-by: Patrick José Pereira <[email protected]>
1 parent 63ee923 commit cb2be56

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

tests/ui/if_same_then_else2.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
clippy::blacklisted_name,
44
clippy::collapsible_if,
55
clippy::ifs_same_cond,
6-
clippy::needless_return
6+
clippy::needless_return,
7+
clippy::single_element_loop
78
)]
89

910
fn if_same_then_else2() -> Result<&'static str, ()> {

tests/ui/if_same_then_else2.stderr

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: this `if` has identical blocks
2-
--> $DIR/if_same_then_else2.rs:19:12
2+
--> $DIR/if_same_then_else2.rs:20:12
33
|
44
LL | } else {
55
| ____________^
@@ -13,7 +13,7 @@ LL | | }
1313
|
1414
= note: `-D clippy::if-same-then-else` implied by `-D warnings`
1515
note: same as this
16-
--> $DIR/if_same_then_else2.rs:10:13
16+
--> $DIR/if_same_then_else2.rs:11:13
1717
|
1818
LL | if true {
1919
| _____________^
@@ -26,7 +26,7 @@ LL | | } else {
2626
| |_____^
2727

2828
error: this `if` has identical blocks
29-
--> $DIR/if_same_then_else2.rs:33:12
29+
--> $DIR/if_same_then_else2.rs:34:12
3030
|
3131
LL | } else {
3232
| ____________^
@@ -36,7 +36,7 @@ LL | | }
3636
| |_____^
3737
|
3838
note: same as this
39-
--> $DIR/if_same_then_else2.rs:31:13
39+
--> $DIR/if_same_then_else2.rs:32:13
4040
|
4141
LL | if true {
4242
| _____________^
@@ -45,7 +45,7 @@ LL | | } else {
4545
| |_____^
4646

4747
error: this `if` has identical blocks
48-
--> $DIR/if_same_then_else2.rs:40:12
48+
--> $DIR/if_same_then_else2.rs:41:12
4949
|
5050
LL | } else {
5151
| ____________^
@@ -55,7 +55,7 @@ LL | | }
5555
| |_____^
5656
|
5757
note: same as this
58-
--> $DIR/if_same_then_else2.rs:38:13
58+
--> $DIR/if_same_then_else2.rs:39:13
5959
|
6060
LL | if true {
6161
| _____________^
@@ -64,7 +64,7 @@ LL | | } else {
6464
| |_____^
6565

6666
error: this `if` has identical blocks
67-
--> $DIR/if_same_then_else2.rs:90:12
67+
--> $DIR/if_same_then_else2.rs:91:12
6868
|
6969
LL | } else {
7070
| ____________^
@@ -74,7 +74,7 @@ LL | | };
7474
| |_____^
7575
|
7676
note: same as this
77-
--> $DIR/if_same_then_else2.rs:88:21
77+
--> $DIR/if_same_then_else2.rs:89:21
7878
|
7979
LL | let _ = if true {
8080
| _____________________^
@@ -83,7 +83,7 @@ LL | | } else {
8383
| |_____^
8484

8585
error: this `if` has identical blocks
86-
--> $DIR/if_same_then_else2.rs:97:12
86+
--> $DIR/if_same_then_else2.rs:98:12
8787
|
8888
LL | } else {
8989
| ____________^
@@ -93,7 +93,7 @@ LL | | }
9393
| |_____^
9494
|
9595
note: same as this
96-
--> $DIR/if_same_then_else2.rs:95:13
96+
--> $DIR/if_same_then_else2.rs:96:13
9797
|
9898
LL | if true {
9999
| _____________^
@@ -102,7 +102,7 @@ LL | | } else {
102102
| |_____^
103103

104104
error: this `if` has identical blocks
105-
--> $DIR/if_same_then_else2.rs:122:12
105+
--> $DIR/if_same_then_else2.rs:123:12
106106
|
107107
LL | } else {
108108
| ____________^
@@ -112,7 +112,7 @@ LL | | }
112112
| |_____^
113113
|
114114
note: same as this
115-
--> $DIR/if_same_then_else2.rs:119:20
115+
--> $DIR/if_same_then_else2.rs:120:20
116116
|
117117
LL | } else if true {
118118
| ____________________^

0 commit comments

Comments
 (0)