-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Improve hir_pretty for struct expressions. #139132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Before: 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}; After: 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 };
compiler-errors
approved these changes
Mar 30, 2025
r? compiler-errors @bors r+ rollup |
jhpratt
added a commit
to jhpratt/rust
that referenced
this pull request
Mar 30, 2025
…iler-errors Improve hir_pretty for struct expressions. While working on rust-lang#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 }; ```
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Mar 30, 2025
Rollup of 6 pull requests Successful merges: - rust-lang#139044 (bootstrap: Avoid cloning `change-id` list) - rust-lang#139111 (Properly document FakeReads) - rust-lang#139113 (unstable book: in a sanitizer example, check the code) - rust-lang#139122 (Remove attribute `#[rustc_error]`) - rust-lang#139132 (Improve hir_pretty for struct expressions.) - rust-lang#139141 (Switch some rustc_on_unimplemented uses to diagnostic::on_unimplemented) r? `@ghost` `@rustbot` modify labels: rollup
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Mar 31, 2025
Rollup of 5 pull requests Successful merges: - rust-lang#139044 (bootstrap: Avoid cloning `change-id` list) - rust-lang#139111 (Properly document FakeReads) - rust-lang#139122 (Remove attribute `#[rustc_error]`) - rust-lang#139132 (Improve hir_pretty for struct expressions.) - rust-lang#139141 (Switch some rustc_on_unimplemented uses to diagnostic::on_unimplemented) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Mar 31, 2025
Rollup merge of rust-lang#139132 - m-ou-se:hir-pp-struct-expr, r=compiler-errors Improve hir_pretty for struct expressions. While working on rust-lang#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 }; ```
github-actions bot
pushed a commit
to model-checking/verify-rust-std
that referenced
this pull request
Apr 2, 2025
Rollup of 5 pull requests Successful merges: - rust-lang#139044 (bootstrap: Avoid cloning `change-id` list) - rust-lang#139111 (Properly document FakeReads) - rust-lang#139122 (Remove attribute `#[rustc_error]`) - rust-lang#139132 (Improve hir_pretty for struct expressions.) - rust-lang#139141 (Switch some rustc_on_unimplemented uses to diagnostic::on_unimplemented) r? `@ghost` `@rustbot` modify labels: rollup
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While working on #139131 I noticed the hir pretty printer outputs an empty line between each field, and is also missing a space before the
{
and the}
:This changes it to: