Add test of dot after eager statement boundary expr

This commit is contained in:
David Tolnay 2024-12-27 13:41:46 -08:00
parent e5f0d6ffbd
commit fef8ec5ad9
No known key found for this signature in database
GPG key ID: F9BA143B95FF6D82

View file

@ -108,6 +108,10 @@ static EXPRS: &[&str] = &[
"{ (match 2 {})() - 1 }",
"{ (match 2 {})[0] - 1 }",
"{ (loop {}) - 1 }",
"match 2 { _ => (loop {}) - 1 }",
// No eager statement boundary if followed by `.` or `?`.
"{ (loop {}).to_string() - 1 }", // FIXME: no parenthesis needed.
"match 2 { _ => (loop {}).to_string() - 1 }", // FIXME: no parenthesis needed.
// Angle bracket is eagerly parsed as a path's generic argument list.
"(2 as T) < U",
"(2 as T<U>) < V", // FIXME: no parentheses needed.