Skip to content

Improve pretty-printing of braces #140312

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nnethercote
Copy link
Contributor

@nnethercote nnethercote commented Apr 25, 2025

@rustbot
Copy link
Collaborator

rustbot commented Apr 25, 2025

Some changes occurred in compiler/rustc_builtin_macros/src/autodiff.rs

cc @ZuseZ4

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 25, 2025
@nnethercote
Copy link
Contributor Author

This is a pretty small change to pretty-printing output. In the past we've done crater runs for such changes. We could do one here too, if you think it's worthwhile.

@petrochenkov
Copy link
Contributor

Add Spacing to DelimArgs to improve pretty-printing. Most notably, this means use statements are printed like use a::{b, c} instead of use a::{ b, c }.

This is very confusing, use items do no use DelimArgs, which are only used for macro invocations/definitions, so why are there changes in them?

@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 28, 2025
@bors

This comment was marked as resolved.

@nnethercote
Copy link
Contributor Author

I addressed the comments.

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 29, 2025
Most notably, the `FIXME` for suboptimal printing of `use` groups in
`tests/ui/macros/stringify.rs` is fixed. And all other test output
changes result in pretty printed output being closer to the original
formatting in the source code.
@nnethercote nnethercote changed the title Improve DelimArgs pretty-printing Apr 29, 2025
@petrochenkov
Copy link
Contributor

@bors r+

@bors
Copy link
Collaborator

bors commented Apr 29, 2025

📌 Commit 99f6b63 has been approved by petrochenkov

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 29, 2025
Zalathar added a commit to Zalathar/rust that referenced this pull request Apr 29, 2025
…etrochenkov

Improve pretty-printing of braces

r? `@petrochenkov`
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 29, 2025
Rollup of 6 pull requests

Successful merges:

 - rust-lang#139883 (crashes: more tests)
 - rust-lang#140312 (Improve pretty-printing of braces)
 - rust-lang#140392 (compiletest: Remove the libtest-based executor and its dependency)
 - rust-lang#140395 (organize and extend forbidden target feature tests)
 - rust-lang#140422 (unwind: bump `unwinding` dependency to 0.2.6)
 - rust-lang#140432 (Update documentation for `fn target_config`)

r? `@ghost`
`@rustbot` modify labels: rollup
tgross35 added a commit to tgross35/rust that referenced this pull request Apr 29, 2025
…etrochenkov

Improve pretty-printing of braces

r? ``@petrochenkov``
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 29, 2025
Rollup of 8 pull requests

Successful merges:

 - rust-lang#134232 (Share the naked asm impl between cg_ssa and cg_clif)
 - rust-lang#140312 (Improve pretty-printing of braces)
 - rust-lang#140437 (enable msa feature for mips in codegen tests)
 - rust-lang#140438 (Add `rust.debug-assertions-tools` option)
 - rust-lang#140439 (miri: algebraic intrinsics: bring back float non-determinism)
 - rust-lang#140445 (Treat ManuallyDrop as ~const Destruct)
 - rust-lang#140446 (chore: fix some tests)
 - rust-lang#140448 (Rename `rustc_query_append!` to `rustc_with_all_queries!`)

r? `@ghost`
`@rustbot` modify labels: rollup
Zalathar added a commit to Zalathar/rust that referenced this pull request Apr 30, 2025
…etrochenkov

Improve pretty-printing of braces

r? ```@petrochenkov```
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 30, 2025
Rollup of 12 pull requests

Successful merges:

 - rust-lang#136160 (Remove backticks from `ShouldPanic::YesWithMessage`'s `TrFailedMsg`)
 - rust-lang#138087 (Initial implementation of `core_float_math`)
 - rust-lang#139059 (uses_power_alignment: wording tweaks)
 - rust-lang#139192 (mention provenance in the pointer::wrapping_offset docs)
 - rust-lang#140312 (Improve pretty-printing of braces)
 - rust-lang#140404 (rm `TypeVistable` impls for `Canonical`)
 - rust-lang#140437 (enable msa feature for mips in codegen tests)
 - rust-lang#140438 (Add `rust.debug-assertions-tools` option)
 - rust-lang#140439 (miri: algebraic intrinsics: bring back float non-determinism)
 - rust-lang#140445 (Treat ManuallyDrop as ~const Destruct)
 - rust-lang#140446 (chore: fix some tests)
 - rust-lang#140448 (Rename `rustc_query_append!` to `rustc_with_all_queries!`)

Failed merges:

 - rust-lang#140456 (Fix test simd/extract-insert-dyn on s390x)

r? `@ghost`
`@rustbot` modify labels: rollup
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Apr 30, 2025
…etrochenkov

Improve pretty-printing of braces

r? ````@petrochenkov````
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.
4 participants