Skip parenthesis around tuple struct field calls

This commit is contained in:
David Tolnay 2024-12-27 14:25:08 -08:00
parent c95f9f50de
commit 26bb4e6464
No known key found for this signature in database
GPG key ID: F9BA143B95FF6D82
4 changed files with 11 additions and 3 deletions

View file

@ -79,7 +79,7 @@ static EXPRS: &[&str] = &[
"if let _ = (true && false) {}",
// Parentheses to call a named field, but not an unnamed field.
"(self.fun)()",
"(self.0)()", // FIXME: no parenthesis needed.
"self.0()",
// 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 {}) {}",