about summary refs log tree commit diff
path: root/compiler/rustc_llvm/src
diff options
context:
space:
mode:
authorJacob Pratt <jacob@jhpratt.dev>2025-03-30 17:59:29 -0400
committerGitHub <noreply@github.com>2025-03-30 17:59:29 -0400
commitf07a0d117faf37a4bfd6bc6ba91602b456b6b344 (patch)
treed8e33e3c9f37e078725e2807c2e28394728d7259 /compiler/rustc_llvm/src
parenteb424222582784ddf5d5aceb408980d4d3401e4d (diff)
parentd035ca7db384e125d1a5110cefb3872386fa692f (diff)
downloadrust-f07a0d117faf37a4bfd6bc6ba91602b456b6b344.tar.gz
rust-f07a0d117faf37a4bfd6bc6ba91602b456b6b344.zip
Rollup merge of #139132 - m-ou-se:hir-pp-struct-expr, r=compiler-errors
Improve hir_pretty for struct expressions.

While working on https://github.com/rust-lang/rust/pull/139131 I noticed the hir pretty printer outputs an empty line between each field, and is also missing a space before the `{` and the `}`:

```rust
    let a =
        StructWithSomeFields{
            field_1: 1,

            field_2: 2,

            field_3: 3,

            field_4: 4,

            field_5: 5,

            field_6: 6,};

    let a = StructWithSomeFields{ field_1: 1,  field_2: 2, ..a};
```

This changes it to:

```rust
    let a =
        StructWithSomeFields {
            field_1: 1,
            field_2: 2,
            field_3: 3,
            field_4: 4,
            field_5: 5,
            field_6: 6 };

    let a = StructWithSomeFields { field_1: 1, field_2: 2, ..a };
```
Diffstat (limited to 'compiler/rustc_llvm/src')
0 files changed, 0 insertions, 0 deletions