Skip to content

Commit 39f6aa2

Browse files
committed
Fix tidy
1 parent 6c90f92 commit 39f6aa2

File tree

4 files changed

+17
-3
lines changed

4 files changed

+17
-3
lines changed

compiler/rustc_parse/src/parser/expr.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// ignore-tidy-filelength
12
use super::diagnostics::SnapshotParser;
23
use super::pat::{CommaRecoveryMode, Expected, RecoverColon, RecoverComma};
34
use super::ty::{AllowPlus, RecoverQPath, RecoverReturnSign};
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

+2-1
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 {
@@ -8,4 +9,4 @@ fn main() {
89
_ => 0u8,
910
};
1011
let _y: u32 = x; //~ ERROR mismatched types
11-
}
12+
}

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

+2-2
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)