Skip to content

Conversation

@Kivooeo
Copy link
Member

@Kivooeo Kivooeo commented Jan 5, 2026

not sure

  1. if there any tests that i need to adjust
  2. if i should add any test for it
  3. if humanity has come up with anything better than checking if that's first iteration or not with flag when printing sequences with separator

in case there is no tests for it and i dont have to add any, there is a demonstration of this ✨ pretty ✨ printing (this is output from -Z unpretty=hir)

fn test_errors<const N:
    usize>() {
    // accepts_enum::<{ None::<u32> }>();
    accepts_point::<Point1 { a: N, b: N }>();
    accepts_point::<Point(N, N)>();
}

btw it does not print const block

for this

accepts_point::<{ Point1 { a: const {N + 1}, b: N } }>();

it will print

accepts_point::<Point1 { a: { N + 1 }, b: N }>();

not sure if we want to print const blocks or not

r? BoxyUwU

@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 Jan 5, 2026
@rustbot
Copy link
Collaborator

rustbot commented Jan 5, 2026

BoxyUwU is currently at their maximum review capacity.
They may take a while to respond.

Copy link
Member

@BoxyUwU BoxyUwU left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should be able to use self.commasep to do the comma delimited lists with handling of omitting the comma if its only one element.

View changes since this review


fn print_const_arg(&mut self, const_arg: &hir::ConstArg<'_>) {
match &const_arg.kind {
// FIXME(mgca): proper printing for struct exprs
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove fixme :3

@BoxyUwU
Copy link
Member

BoxyUwU commented Jan 5, 2026

I think we probably do want to print const blocks 🤔 The best way to accomplish that is likely to change the printing for ConstArgKind::Anon to do emit const under mgca

@BoxyUwU
Copy link
Member

BoxyUwU commented Jan 5, 2026

I think you can write a test for this by adding //@ compile-flags: -Zunpretty=hir

@Kivooeo
Copy link
Member Author

Kivooeo commented Jan 5, 2026

I think we probably do want to print const blocks 🤔 The best way to accomplish that is likely to change the printing for ConstArgKind::Anon to do emit const under mgca

not sure about how to make it yet, will take a look for it a bit later, for now just added a test and rewrited with self.commasep

@BoxyUwU
Copy link
Member

BoxyUwU commented Jan 5, 2026

thanks

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Jan 5, 2026

📌 Commit 85c8e41 has been approved by BoxyUwU

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 Jan 5, 2026
Zalathar added a commit to Zalathar/rust that referenced this pull request Jan 6, 2026
MGCA: pretty printing for struct expressions and tuple calls

not sure

1. if there any tests that i need to adjust
2. if i should add any test for it
3. if humanity has come up with anything better than checking if that's first iteration or not with flag when printing sequences with separator

in case there is no tests for it and i dont have to add any, there is a demonstration of this ✨ pretty ✨ printing (this is output from `-Z unpretty=hir`)

```
fn test_errors<const N:
    usize>() {
    // accepts_enum::<{ None::<u32> }>();
    accepts_point::<Point1 { a: N, b: N }>();
    accepts_point::<Point(N, N)>();
}
```

btw it does not print const block

for this

```
accepts_point::<{ Point1 { a: const {N + 1}, b: N } }>();
```

it will print

```
accepts_point::<Point1 { a: { N + 1 }, b: N }>();
```

not sure if we want to print const blocks or not

r? BoxyUwU
bors added a commit that referenced this pull request Jan 6, 2026
Rollup of 8 pull requests

Successful merges:

 - #144113 (Impls and impl items inherit `dead_code` lint level of the corresponding traits and trait items)
 - #149880 (rustc_codegen_llvm: update alignment for double on AIX)
 - #150668 (Unix implementation for stdio set/take/replace)
 - #150670 (THIR pattern building: Move all `thir::Pat` creation into `rustc_mir_build::thir::pattern`)
 - #150695 (MGCA: pretty printing for struct expressions and tuple calls )
 - #150698 (Improve comment clarity in candidate_may_shadow)
 - #150706 (Update wasm-component-ld)
 - #150710 (Update libc dependency of std)

r? `@ghost`
`@rustbot` modify labels: rollup
Zalathar added a commit to Zalathar/rust that referenced this pull request Jan 6, 2026
MGCA: pretty printing for struct expressions and tuple calls

not sure

1. if there any tests that i need to adjust
2. if i should add any test for it
3. if humanity has come up with anything better than checking if that's first iteration or not with flag when printing sequences with separator

in case there is no tests for it and i dont have to add any, there is a demonstration of this ✨ pretty ✨ printing (this is output from `-Z unpretty=hir`)

```
fn test_errors<const N:
    usize>() {
    // accepts_enum::<{ None::<u32> }>();
    accepts_point::<Point1 { a: N, b: N }>();
    accepts_point::<Point(N, N)>();
}
```

btw it does not print const block

for this

```
accepts_point::<{ Point1 { a: const {N + 1}, b: N } }>();
```

it will print

```
accepts_point::<Point1 { a: { N + 1 }, b: N }>();
```

not sure if we want to print const blocks or not

r? BoxyUwU
bors added a commit that referenced this pull request Jan 6, 2026
Rollup of 8 pull requests

Successful merges:

 - #144113 (Impls and impl items inherit `dead_code` lint level of the corresponding traits and trait items)
 - #149880 (rustc_codegen_llvm: update alignment for double on AIX)
 - #150412 (use PIDFD_GET_INFO ioctl when available)
 - #150668 (Unix implementation for stdio set/take/replace)
 - #150670 (THIR pattern building: Move all `thir::Pat` creation into `rustc_mir_build::thir::pattern`)
 - #150695 (MGCA: pretty printing for struct expressions and tuple calls )
 - #150698 (Improve comment clarity in candidate_may_shadow)
 - #150706 (Update wasm-component-ld)

r? `@ghost`
`@rustbot` modify labels: rollup
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jan 6, 2026
MGCA: pretty printing for struct expressions and tuple calls

not sure

1. if there any tests that i need to adjust
2. if i should add any test for it
3. if humanity has come up with anything better than checking if that's first iteration or not with flag when printing sequences with separator

in case there is no tests for it and i dont have to add any, there is a demonstration of this ✨ pretty ✨ printing (this is output from `-Z unpretty=hir`)

```
fn test_errors<const N:
    usize>() {
    // accepts_enum::<{ None::<u32> }>();
    accepts_point::<Point1 { a: N, b: N }>();
    accepts_point::<Point(N, N)>();
}
```

btw it does not print const block

for this

```
accepts_point::<{ Point1 { a: const {N + 1}, b: N } }>();
```

it will print

```
accepts_point::<Point1 { a: { N + 1 }, b: N }>();
```

not sure if we want to print const blocks or not

r? BoxyUwU
bors added a commit that referenced this pull request Jan 6, 2026
…uwer

Rollup of 11 pull requests

Successful merges:

 - #144113 (Impls and impl items inherit `dead_code` lint level of the corresponding traits and trait items)
 - #148339 (naked functions: emit `.private_extern` on macos)
 - #149880 (rustc_codegen_llvm: update alignment for double on AIX)
 - #150122 (Refactor function names of `rustc_ast_lowering`)
 - #150412 (use PIDFD_GET_INFO ioctl when available)
 - #150670 (THIR pattern building: Move all `thir::Pat` creation into `rustc_mir_build::thir::pattern`)
 - #150695 (MGCA: pretty printing for struct expressions and tuple calls )
 - #150698 (Improve comment clarity in candidate_may_shadow)
 - #150706 (Update wasm-component-ld)
 - #150707 (Fix ICE when transmute Assume field is invalid)
 - #150708 (Enable merge queue in new bors)

r? `@ghost`
`@rustbot` modify labels: rollup
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jan 6, 2026
MGCA: pretty printing for struct expressions and tuple calls

not sure

1. if there any tests that i need to adjust
2. if i should add any test for it
3. if humanity has come up with anything better than checking if that's first iteration or not with flag when printing sequences with separator

in case there is no tests for it and i dont have to add any, there is a demonstration of this ✨ pretty ✨ printing (this is output from `-Z unpretty=hir`)

```
fn test_errors<const N:
    usize>() {
    // accepts_enum::<{ None::<u32> }>();
    accepts_point::<Point1 { a: N, b: N }>();
    accepts_point::<Point(N, N)>();
}
```

btw it does not print const block

for this

```
accepts_point::<{ Point1 { a: const {N + 1}, b: N } }>();
```

it will print

```
accepts_point::<Point1 { a: { N + 1 }, b: N }>();
```

not sure if we want to print const blocks or not

r? BoxyUwU
bors added a commit that referenced this pull request Jan 6, 2026
Rollup of 11 pull requests

Successful merges:

 - #144113 (Impls and impl items inherit `dead_code` lint level of the corresponding traits and trait items)
 - #148339 (naked functions: emit `.private_extern` on macos)
 - #149880 (rustc_codegen_llvm: update alignment for double on AIX)
 - #150122 (Refactor function names of `rustc_ast_lowering`)
 - #150412 (use PIDFD_GET_INFO ioctl when available)
 - #150670 (THIR pattern building: Move all `thir::Pat` creation into `rustc_mir_build::thir::pattern`)
 - #150695 (MGCA: pretty printing for struct expressions and tuple calls )
 - #150698 (Improve comment clarity in candidate_may_shadow)
 - #150706 (Update wasm-component-ld)
 - #150707 (Fix ICE when transmute Assume field is invalid)
 - #150708 (Enable merge queue in new bors)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit that referenced this pull request Jan 6, 2026
…uwer

Rollup of 10 pull requests

Successful merges:

 - #144113 (Impls and impl items inherit `dead_code` lint level of the corresponding traits and trait items)
 - #149880 (rustc_codegen_llvm: update alignment for double on AIX)
 - #150122 (Refactor function names of `rustc_ast_lowering`)
 - #150412 (use PIDFD_GET_INFO ioctl when available)
 - #150670 (THIR pattern building: Move all `thir::Pat` creation into `rustc_mir_build::thir::pattern`)
 - #150695 (MGCA: pretty printing for struct expressions and tuple calls )
 - #150698 (Improve comment clarity in candidate_may_shadow)
 - #150706 (Update wasm-component-ld)
 - #150707 (Fix ICE when transmute Assume field is invalid)
 - #150708 (Enable merge queue in new bors)

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants