about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorDavid Tolnay <dtolnay@gmail.com>2024-12-27 18:43:05 -0800
committerGitHub <noreply@github.com>2024-12-27 18:43:05 -0800
commit0a09252866e87a1531584bb3066dbd7d51078408 (patch)
tree93e3a7b864d3651cad3eee99fc851a10ae6dd1a9 /compiler/rustc_codegen_llvm/src
parent3fc0f08b8988e8864effd2ccaa6187df524e892e (diff)
parent26bb4e64645d3f3e0ed0b2921738e56888f96fd1 (diff)
downloadrust-0a09252866e87a1531584bb3066dbd7d51078408.tar.gz
rust-0a09252866e87a1531584bb3066dbd7d51078408.zip
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();
}
```
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions