mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
add UI test for delimiter errors
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
fn foo() {
|
||||
match 0 {
|
||||
_ => {}
|
||||
}
|
||||
if foo
|
||||
}
|
||||
} //~ ERROR unexpected closing delimiter: `}`
|
||||
|
||||
fn main() {}
|
||||
@@ -0,0 +1,16 @@
|
||||
error: unexpected closing delimiter: `}`
|
||||
--> $DIR/issue-98601-delimiter-error-1.rs:7:1
|
||||
|
|
||||
LL | fn foo() {
|
||||
| - this delimiter might not be properly closed...
|
||||
LL | match 0 {
|
||||
LL | _ => {}
|
||||
| -- block is empty, you might have not meant to close it
|
||||
...
|
||||
LL | }
|
||||
| - ...as it matches this but it has different indentation
|
||||
LL | }
|
||||
| ^ unexpected closing delimiter
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
fn main() {
|
||||
todo!();
|
||||
}
|
||||
|
||||
fn other(_: i32)) {} //~ ERROR unexpected closing delimiter: `)`
|
||||
@@ -0,0 +1,14 @@
|
||||
error: unexpected closing delimiter: `)`
|
||||
--> $DIR/issue-98601-delimiter-error-unexpected-close.rs:5:17
|
||||
|
|
||||
LL | fn main() {
|
||||
| - this opening brace...
|
||||
LL | todo!();
|
||||
LL | }
|
||||
| - ...matches this closing brace
|
||||
LL |
|
||||
LL | fn other(_: i32)) {}
|
||||
| ^ unexpected closing delimiter
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
Reference in New Issue
Block a user