Add ui test unnessary-error-issue-138401.rs

Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
This commit is contained in:
xizheyin 2025-06-24 16:09:42 +08:00
parent 0d11be5aab
commit 229be21d0d
2 changed files with 26 additions and 0 deletions

View file

@ -0,0 +1,7 @@
pub fn foo(x: i64) -> i64 {
x.abs)
//~^ ERROR mismatched closing delimiter
}
//~^ ERROR unexpected closing delimiter: `}`
fn main() {}

View file

@ -0,0 +1,19 @@
error: mismatched closing delimiter: `)`
--> $DIR/unnessary-error-issue-138401.rs:1:27
|
LL | pub fn foo(x: i64) -> i64 {
| ^ unclosed delimiter
LL | x.abs)
| ^ mismatched closing delimiter
error: unexpected closing delimiter: `}`
--> $DIR/unnessary-error-issue-138401.rs:4:1
|
LL | x.abs)
| - missing open `(` for this delimiter
LL |
LL | }
| ^ unexpected closing delimiter
error: aborting due to 2 previous errors