From fef8ec5ad9ccd3249d616520e22e43602fa47883 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Fri, 27 Dec 2024 13:41:46 -0800 Subject: [PATCH] Add test of dot after eager statement boundary expr --- tests/ui-fulldeps/pprust-parenthesis-insertion.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/ui-fulldeps/pprust-parenthesis-insertion.rs b/tests/ui-fulldeps/pprust-parenthesis-insertion.rs index 94c7964392d1..8cef9fa13f90 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) < V", // FIXME: no parentheses needed.