about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorDavid Tolnay <dtolnay@gmail.com>2024-12-27 14:18:39 -0800
committerDavid Tolnay <dtolnay@gmail.com>2024-12-27 14:18:39 -0800
commitc95f9f50de555454cbd931c026814e46793a820a (patch)
tree59c61f053fa8800655755bdfe8bf211bcdb3d6f5 /tests
parente5f0d6ffbda2d23ca6729c3f93a8f54d86f920d5 (diff)
downloadrust-c95f9f50de555454cbd931c026814e46793a820a.tar.gz
rust-c95f9f50de555454cbd931c026814e46793a820a.zip
Add pretty-printer test of tuple field function call
Diffstat (limited to 'tests')
-rw-r--r--tests/ui-fulldeps/pprust-parenthesis-insertion.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/ui-fulldeps/pprust-parenthesis-insertion.rs b/tests/ui-fulldeps/pprust-parenthesis-insertion.rs
index 94c7964392d..fa9b0300743 100644
--- a/tests/ui-fulldeps/pprust-parenthesis-insertion.rs
+++ b/tests/ui-fulldeps/pprust-parenthesis-insertion.rs
@@ -77,6 +77,9 @@ static EXPRS: &[&str] = &[
     // These mean different things.
     "if let _ = true && false {}",
     "if let _ = (true && false) {}",
+    // Parentheses to call a named field, but not an unnamed field.
+    "(self.fun)()",
+    "(self.0)()",  // FIXME: no parenthesis needed.
     // Conditions end at the first curly brace, so struct expressions need to be
     // parenthesized. Except in a match guard, where conditions end at arrow.
     "if let _ = (Struct {}) {}",