Skip to content

Commit 574d4a9

Browse files
committed
Update remaining test files
1 parent 0db8e59 commit 574d4a9

7 files changed

+101
-101
lines changed

tests/ui/collapsible_else_if.fixed

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -10,57 +10,57 @@ fn main() {
1010
if x == "hello" {
1111
print!("Hello ");
1212
} else if y == "world" {
13-
println!("world!")
14-
}
13+
println!("world!")
14+
}
1515

1616
if x == "hello" {
1717
print!("Hello ");
1818
} else if let Some(42) = Some(42) {
19-
println!("world!")
20-
}
19+
println!("world!")
20+
}
2121

2222
if x == "hello" {
2323
print!("Hello ");
2424
} else if y == "world" {
25-
println!("world")
26-
}
27-
else {
28-
println!("!")
29-
}
25+
println!("world")
26+
}
27+
else {
28+
println!("!")
29+
}
3030

3131
if x == "hello" {
3232
print!("Hello ");
3333
} else if let Some(42) = Some(42) {
34-
println!("world")
35-
}
36-
else {
37-
println!("!")
38-
}
34+
println!("world")
35+
}
36+
else {
37+
println!("!")
38+
}
3939

4040
if let Some(42) = Some(42) {
4141
print!("Hello ");
4242
} else if let Some(42) = Some(42) {
43-
println!("world")
44-
}
45-
else {
46-
println!("!")
47-
}
43+
println!("world")
44+
}
45+
else {
46+
println!("!")
47+
}
4848

4949
if let Some(42) = Some(42) {
5050
print!("Hello ");
5151
} else if x == "hello" {
52-
println!("world")
53-
}
54-
else {
55-
println!("!")
56-
}
52+
println!("world")
53+
}
54+
else {
55+
println!("!")
56+
}
5757

5858
if let Some(42) = Some(42) {
5959
print!("Hello ");
6060
} else if let Some(42) = Some(42) {
61-
println!("world")
62-
}
63-
else {
64-
println!("!")
65-
}
61+
println!("world")
62+
}
63+
else {
64+
println!("!")
65+
}
6666
}

tests/ui/collapsible_else_if.stderr

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ LL | | }
1313
help: try
1414
|
1515
LL | } else if y == "world" {
16-
LL | println!("world!")
17-
LL | }
16+
LL | println!("world!")
17+
LL | }
1818
|
1919

2020
error: this `else { if .. }` block can be collapsed
@@ -31,8 +31,8 @@ LL | | }
3131
help: try
3232
|
3333
LL | } else if let Some(42) = Some(42) {
34-
LL | println!("world!")
35-
LL | }
34+
LL | println!("world!")
35+
LL | }
3636
|
3737

3838
error: this `else { if .. }` block can be collapsed
@@ -51,11 +51,11 @@ LL | | }
5151
help: try
5252
|
5353
LL | } else if y == "world" {
54-
LL | println!("world")
55-
LL | }
56-
LL | else {
57-
LL | println!("!")
58-
LL | }
54+
LL | println!("world")
55+
LL | }
56+
LL | else {
57+
LL | println!("!")
58+
LL | }
5959
|
6060

6161
error: this `else { if .. }` block can be collapsed
@@ -74,11 +74,11 @@ LL | | }
7474
help: try
7575
|
7676
LL | } else if let Some(42) = Some(42) {
77-
LL | println!("world")
78-
LL | }
79-
LL | else {
80-
LL | println!("!")
81-
LL | }
77+
LL | println!("world")
78+
LL | }
79+
LL | else {
80+
LL | println!("!")
81+
LL | }
8282
|
8383

8484
error: this `else { if .. }` block can be collapsed
@@ -97,11 +97,11 @@ LL | | }
9797
help: try
9898
|
9999
LL | } else if let Some(42) = Some(42) {
100-
LL | println!("world")
101-
LL | }
102-
LL | else {
103-
LL | println!("!")
104-
LL | }
100+
LL | println!("world")
101+
LL | }
102+
LL | else {
103+
LL | println!("!")
104+
LL | }
105105
|
106106

107107
error: this `else { if .. }` block can be collapsed
@@ -120,11 +120,11 @@ LL | | }
120120
help: try
121121
|
122122
LL | } else if x == "hello" {
123-
LL | println!("world")
124-
LL | }
125-
LL | else {
126-
LL | println!("!")
127-
LL | }
123+
LL | println!("world")
124+
LL | }
125+
LL | else {
126+
LL | println!("!")
127+
LL | }
128128
|
129129

130130
error: this `else { if .. }` block can be collapsed
@@ -143,11 +143,11 @@ LL | | }
143143
help: try
144144
|
145145
LL | } else if let Some(42) = Some(42) {
146-
LL | println!("world")
147-
LL | }
148-
LL | else {
149-
LL | println!("!")
150-
LL | }
146+
LL | println!("world")
147+
LL | }
148+
LL | else {
149+
LL | println!("!")
150+
LL | }
151151
|
152152

153153
error: aborting due to 7 previous errors

tests/ui/collapsible_if.fixed

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,28 @@ fn main() {
77
let x = "hello";
88
let y = "world";
99
if x == "hello" && y == "world" {
10-
println!("Hello world!");
11-
}
10+
println!("Hello world!");
11+
}
1212

1313
if (x == "hello" || x == "world") && (y == "world" || y == "hello") {
14-
println!("Hello world!");
15-
}
14+
println!("Hello world!");
15+
}
1616

1717
if x == "hello" && x == "world" && (y == "world" || y == "hello") {
18-
println!("Hello world!");
19-
}
18+
println!("Hello world!");
19+
}
2020

2121
if (x == "hello" || x == "world") && y == "world" && y == "hello" {
22-
println!("Hello world!");
23-
}
22+
println!("Hello world!");
23+
}
2424

2525
if x == "hello" && x == "world" && y == "world" && y == "hello" {
26-
println!("Hello world!");
27-
}
26+
println!("Hello world!");
27+
}
2828

2929
if 42 == 1337 && 'a' != 'A' {
30-
println!("world!")
31-
}
30+
println!("world!")
31+
}
3232

3333
// Works because any if with an else statement cannot be collapsed.
3434
if x == "hello" {
@@ -81,8 +81,8 @@ fn main() {
8181
}
8282

8383
if x == "hello" && y == "world" { // Collapsible
84-
println!("Hello world!");
85-
}
84+
println!("Hello world!");
85+
}
8686

8787
if x == "hello" {
8888
print!("Hello ");

tests/ui/collapsible_if.stderr

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ LL | | }
1212
help: try
1313
|
1414
LL | if x == "hello" && y == "world" {
15-
LL | println!("Hello world!");
16-
LL | }
15+
LL | println!("Hello world!");
16+
LL | }
1717
|
1818

1919
error: this `if` statement can be collapsed
@@ -29,8 +29,8 @@ LL | | }
2929
help: try
3030
|
3131
LL | if (x == "hello" || x == "world") && (y == "world" || y == "hello") {
32-
LL | println!("Hello world!");
33-
LL | }
32+
LL | println!("Hello world!");
33+
LL | }
3434
|
3535

3636
error: this `if` statement can be collapsed
@@ -46,8 +46,8 @@ LL | | }
4646
help: try
4747
|
4848
LL | if x == "hello" && x == "world" && (y == "world" || y == "hello") {
49-
LL | println!("Hello world!");
50-
LL | }
49+
LL | println!("Hello world!");
50+
LL | }
5151
|
5252

5353
error: this `if` statement can be collapsed
@@ -63,8 +63,8 @@ LL | | }
6363
help: try
6464
|
6565
LL | if (x == "hello" || x == "world") && y == "world" && y == "hello" {
66-
LL | println!("Hello world!");
67-
LL | }
66+
LL | println!("Hello world!");
67+
LL | }
6868
|
6969

7070
error: this `if` statement can be collapsed
@@ -80,8 +80,8 @@ LL | | }
8080
help: try
8181
|
8282
LL | if x == "hello" && x == "world" && y == "world" && y == "hello" {
83-
LL | println!("Hello world!");
84-
LL | }
83+
LL | println!("Hello world!");
84+
LL | }
8585
|
8686

8787
error: this `if` statement can be collapsed
@@ -97,8 +97,8 @@ LL | | }
9797
help: try
9898
|
9999
LL | if 42 == 1337 && 'a' != 'A' {
100-
LL | println!("world!")
101-
LL | }
100+
LL | println!("world!")
101+
LL | }
102102
|
103103

104104
error: this `if` statement can be collapsed
@@ -114,8 +114,8 @@ LL | | }
114114
help: try
115115
|
116116
LL | if x == "hello" && y == "world" { // Collapsible
117-
LL | println!("Hello world!");
118-
LL | }
117+
LL | println!("Hello world!");
118+
LL | }
119119
|
120120

121121
error: aborting due to 7 previous errors

tests/ui/match_bool.stderr

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ LL | | };
4040
help: consider using an `if`/`else` expression
4141
|
4242
LL | if !test {
43-
LL | println!("Noooo!");
44-
LL | };
43+
LL | println!("Noooo!");
44+
LL | };
4545
|
4646

4747
error: you seem to be trying to match on a boolean expression
@@ -58,8 +58,8 @@ LL | | };
5858
help: consider using an `if`/`else` expression
5959
|
6060
LL | if !test {
61-
LL | println!("Noooo!");
62-
LL | };
61+
LL | println!("Noooo!");
62+
LL | };
6363
|
6464

6565
error: you seem to be trying to match on a boolean expression
@@ -76,8 +76,8 @@ LL | | };
7676
help: consider using an `if`/`else` expression
7777
|
7878
LL | if !(test && test) {
79-
LL | println!("Noooo!");
80-
LL | };
79+
LL | println!("Noooo!");
80+
LL | };
8181
|
8282

8383
error: equal expressions as operands to `&&`
@@ -103,10 +103,10 @@ LL | | };
103103
help: consider using an `if`/`else` expression
104104
|
105105
LL | if test {
106-
LL | println!("Yes!");
107-
LL | } else {
108-
LL | println!("Noooo!");
109-
LL | };
106+
LL | println!("Yes!");
107+
LL | } else {
108+
LL | println!("Noooo!");
109+
LL | };
110110
|
111111

112112
error: aborting due to 8 previous errors

tests/ui/single_match.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ LL | | };
1313
help: try this
1414
|
1515
LL | if let Some(y) = x {
16-
LL | println!("{:?}", y);
17-
LL | };
16+
LL | println!("{:?}", y);
17+
LL | };
1818
|
1919

2020
error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let`

tests/ui/single_match_else.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ LL | | }
1414
help: try this
1515
|
1616
LL | if let ExprNode::ExprAddrOf = ExprNode::Butterflies { Some(&NODE) } else {
17-
LL | let x = 5;
18-
LL | None
19-
LL | }
17+
LL | let x = 5;
18+
LL | None
19+
LL | }
2020
|
2121

2222
error: aborting due to previous error

0 commit comments

Comments
 (0)