mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-26 14:43:24 +00:00
add UI test for delimiter errors
This commit is contained in:
parent
62d9034a0d
commit
f7cd892b5a
9
tests/ui/parser/issues/issue-98601-delimiter-error-1.rs
Normal file
9
tests/ui/parser/issues/issue-98601-delimiter-error-1.rs
Normal file
@ -0,0 +1,9 @@
|
||||
fn foo() {
|
||||
match 0 {
|
||||
_ => {}
|
||||
}
|
||||
if foo
|
||||
}
|
||||
} //~ ERROR unexpected closing delimiter: `}`
|
||||
|
||||
fn main() {}
|
16
tests/ui/parser/issues/issue-98601-delimiter-error-1.stderr
Normal file
16
tests/ui/parser/issues/issue-98601-delimiter-error-1.stderr
Normal file
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user