Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 147faa5

Browse files
committed
Fix tidy
1 parent bd1feb8 commit 147faa5

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// run-rustfix
2+
fn main() {
3+
let val = 42;
4+
let x = match val {
5+
0 if true => {
6+
//~^ ERROR unexpected parentheses surrounding `match` arm pattern
7+
42u8
8+
}
9+
_ => 0u8,
10+
};
11+
let _y: u32 = x.into(); //~ ERROR mismatched types
12+
}

tests/ui/parser/recover/recover-parens-around-match-arm-head.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// run-rustfix
12
fn main() {
23
let val = 42;
34
let x = match val {

tests/ui/parser/recover/recover-parens-around-match-arm-head.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: unexpected parentheses surrounding `match` arm pattern
2-
--> $DIR/recover-parens-around-match-arm-head.rs:4:9
2+
--> $DIR/recover-parens-around-match-arm-head.rs:5:9
33
|
44
LL | (0 if true) => {
55
| ^ ^
@@ -11,7 +11,7 @@ LL + 0 if true => {
1111
|
1212

1313
error[E0308]: mismatched types
14-
--> $DIR/recover-parens-around-match-arm-head.rs:10:19
14+
--> $DIR/recover-parens-around-match-arm-head.rs:11:19
1515
|
1616
LL | let _y: u32 = x;
1717
| --- ^ expected `u32`, found `u8`

0 commit comments

Comments
 (0)