Skip to content

Commit 54b190c

Browse files
committed
add test for delimiter mismatch
1 parent 1a8e69a commit 54b190c

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// This file has unexpected closing delimiter,
2+
3+
fn func(o: Option<u32>) {
4+
match o {
5+
Some(_x) => {} // Extra '}'
6+
let _ = if true {};
7+
}
8+
None => {}
9+
}
10+
} //~ ERROR unexpected closing delimiter
11+
12+
fn main() {}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error: unexpected closing delimiter: `}`
2+
--> $DIR/issue-68987-unmatch-issue-1.rs:10:1
3+
|
4+
LL | match o {
5+
| - this delimiter might not be properly closed...
6+
...
7+
LL | }
8+
| - ...as it matches this but it has different indentation
9+
...
10+
LL | }
11+
| ^ unexpected closing delimiter
12+
13+
error: aborting due to previous error
14+

src/test/ui/parser/issue-68987-unmatch-issue.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
fn func(o: Option<u32>) {
44
match o {
5-
Some(_x) =>
5+
Some(_x) => // Missing '{'
66
let _ = if true {};
77
}
88
None => {}

0 commit comments

Comments
 (0)