about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDavid Tolnay <dtolnay@gmail.com>2024-12-27 13:41:46 -0800
committerDavid Tolnay <dtolnay@gmail.com>2024-12-27 13:41:46 -0800
commitfef8ec5ad9ccd3249d616520e22e43602fa47883 (patch)
tree46d15c0403b02448fc9fb2eaa3b3aa3b10ed767b
parente5f0d6ffbda2d23ca6729c3f93a8f54d86f920d5 (diff)
downloadrust-fef8ec5ad9ccd3249d616520e22e43602fa47883.tar.gz
rust-fef8ec5ad9ccd3249d616520e22e43602fa47883.zip
Add test of dot after eager statement boundary expr
-rw-r--r--tests/ui-fulldeps/pprust-parenthesis-insertion.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/ui-fulldeps/pprust-parenthesis-insertion.rs b/tests/ui-fulldeps/pprust-parenthesis-insertion.rs
index 94c7964392d..8cef9fa13f9 100644
--- a/tests/ui-fulldeps/pprust-parenthesis-insertion.rs
+++ b/tests/ui-fulldeps/pprust-parenthesis-insertion.rs
@@ -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.