Add pretty-printer test of tuple field function call

This commit is contained in:
David Tolnay 2024-12-27 14:18:39 -08:00
parent e5f0d6ffbd
commit c95f9f50de
No known key found for this signature in database
GPG key ID: F9BA143B95FF6D82

View file

@ -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 {}) {}",