Skip to content

Commit d5e7df3

Browse files
authored
Rollup merge of #116034 - chenyukang:yukang-98601-add-ui-testcase, r=estebank
add UI test for delimiter errors Fixes #98601 from #98601 (comment) r? `@estebank`
2 parents 9887dfa + f7cd892 commit d5e7df3

4 files changed

+44
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
fn foo() {
2+
match 0 {
3+
_ => {}
4+
}
5+
if foo
6+
}
7+
} //~ ERROR unexpected closing delimiter: `}`
8+
9+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
error: unexpected closing delimiter: `}`
2+
--> $DIR/issue-98601-delimiter-error-1.rs:7:1
3+
|
4+
LL | fn foo() {
5+
| - this delimiter might not be properly closed...
6+
LL | match 0 {
7+
LL | _ => {}
8+
| -- block is empty, you might have not meant to close it
9+
...
10+
LL | }
11+
| - ...as it matches this but it has different indentation
12+
LL | }
13+
| ^ unexpected closing delimiter
14+
15+
error: aborting due to previous error
16+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
fn main() {
2+
todo!();
3+
}
4+
5+
fn other(_: i32)) {} //~ ERROR unexpected closing delimiter: `)`
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error: unexpected closing delimiter: `)`
2+
--> $DIR/issue-98601-delimiter-error-unexpected-close.rs:5:17
3+
|
4+
LL | fn main() {
5+
| - this opening brace...
6+
LL | todo!();
7+
LL | }
8+
| - ...matches this closing brace
9+
LL |
10+
LL | fn other(_: i32)) {}
11+
| ^ unexpected closing delimiter
12+
13+
error: aborting due to previous error
14+

0 commit comments

Comments
 (0)