rust/compiler/rustc_ast_pretty/src
David Tolnay 0a09252866
Rollup merge of #134834 - dtolnay:unnamedcall, r=compiler-errors
Skip parenthesis around tuple struct field calls

The pretty-printer previously did not distinguish between named vs unnamed fields when printing a function call containing a struct field. It would print the call as `(self.fun)()` for a named field which is correct, and `(self.0)()` for an unnamed field which is redundant.

This PR changes function calls of tuple struct fields to print without parens.

**Before:**

```rust
struct Tuple(fn());

fn main() {
    let tuple = Tuple(|| {});
    (tuple.0)();
}
```

**After:**

```rust
struct Tuple(fn());

fn main() {
    let tuple = Tuple(|| {});
    tuple.0();
}
```
2024-12-27 18:43:05 -08:00
..
pp Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
pprust Rollup merge of #134834 - dtolnay:unnamedcall, r=compiler-errors 2024-12-27 18:43:05 -08:00
helpers.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
lib.rs Add warn(unreachable_pub) to rustc_ast_pretty. 2024-08-16 08:46:46 +10:00
pp.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00