diff options
| author | David Tolnay <dtolnay@gmail.com> | 2024-12-27 13:41:46 -0800 |
|---|---|---|
| committer | David Tolnay <dtolnay@gmail.com> | 2024-12-27 13:41:46 -0800 |
| commit | fef8ec5ad9ccd3249d616520e22e43602fa47883 (patch) | |
| tree | 46d15c0403b02448fc9fb2eaa3b3aa3b10ed767b | |
| parent | e5f0d6ffbda2d23ca6729c3f93a8f54d86f920d5 (diff) | |
| download | rust-fef8ec5ad9ccd3249d616520e22e43602fa47883.tar.gz rust-fef8ec5ad9ccd3249d616520e22e43602fa47883.zip | |
Add test of dot after eager statement boundary expr
| -rw-r--r-- | tests/ui-fulldeps/pprust-parenthesis-insertion.rs | 4 |
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. |
