Skip to content

Commit

Permalink
Fix tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Nov 6, 2023
1 parent 6c90f92 commit 39f6aa2
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
1 change: 1 addition & 0 deletions compiler/rustc_parse/src/parser/expr.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// ignore-tidy-filelength
use super::diagnostics::SnapshotParser;
use super::pat::{CommaRecoveryMode, Expected, RecoverColon, RecoverComma};
use super::ty::{AllowPlus, RecoverQPath, RecoverReturnSign};
Expand Down
12 changes: 12 additions & 0 deletions tests/ui/parser/recover/recover-parens-around-match-arm-head.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// run-rustfix
fn main() {
let val = 42;
let x = match val {
0 if true => {
//~^ ERROR unexpected parentheses surrounding `match` arm pattern
42u8
}
_ => 0u8,
};
let _y: u32 = x.into(); //~ ERROR mismatched types
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// run-rustfix
fn main() {
let val = 42;
let x = match val {
Expand All @@ -8,4 +9,4 @@ fn main() {
_ => 0u8,
};
let _y: u32 = x; //~ ERROR mismatched types
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: unexpected parentheses surrounding `match` arm pattern
--> $DIR/recover-parens-around-match-arm-head.rs:4:9
--> $DIR/recover-parens-around-match-arm-head.rs:5:9
|
LL | (0 if true) => {
| ^ ^
Expand All @@ -11,7 +11,7 @@ LL + 0 if true => {
|

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

0 comments on commit 39f6aa2

Please sign in to comment.