Recover from leading comma in tuple pat and expr

This commit is contained in:
Lukas Wirth 2023-06-01 08:40:50 +02:00
parent 42450d2511
commit 7d1bf7023d
7 changed files with 89 additions and 4 deletions

View file

@ -2003,7 +2003,10 @@ fn main() {
let _: (&str, u32, u32)= ($0, 1, 3);
}
"#,
expect![""],
expect![[r#"
(&str, u32)
^^^^ ---
"#]],
);
check(
r#"
@ -2011,7 +2014,10 @@ fn main() {
let _: (&str, u32, u32, u32)= ($0, 1, 3);
}
"#,
expect![""],
expect![[r#"
(&str, u32)
^^^^ ---
"#]],
);
check(
r#"
@ -2019,7 +2025,10 @@ fn main() {
let _: (&str, u32, u32)= ($0, 1, 3, 5);
}
"#,
expect![""],
expect![[r#"
(&str, u32, u32)
^^^^ --- ---
"#]],
);
}
@ -2111,7 +2120,7 @@ fn main() {
check(
r#"
fn main() {
let ($0 1, 3): (i32, i32, i32);
let ($0, 1, 3): (i32, i32, i32);
}
"#,
// FIXME: tuple pat should be of size 3 ideally