Skip to content

Conversation

@tromey
Copy link
Contributor

@tromey tromey commented Nov 5, 2025

While looking at the pretty-printers, I found a few minor oddities in StdNonZeroNumberProvider.

First, gdb.Type.fields() already returns a sequence, so there's no need to call list().

Second, it's more idiomatic for the (somewhat misnamed) to_string method to simply return the underlying gdb.Value. This also lets gdb apply whatever formats were passed to print, as the new test shows.

Third, there's no need to use the field's name when looking up a field in a value, the gdb.Field itself can be used.

While looking at the pretty-printers, I found a few minor oddities in
StdNonZeroNumberProvider.

First, gdb.Type.fields() already returns a sequence, so there's no
need to call list().

Second, it's more idiomatic for the (somewhat misnamed) to_string
method to simply return the underlying gdb.Value.  This also lets gdb
apply whatever formats were passed to `print`, as the new test shows.

Third, there's no need to use the field's name when looking up a field
in a value, the gdb.Field itself can be used.
@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 Nov 5, 2025
@rustbot
Copy link
Collaborator

rustbot commented Nov 5, 2025

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Copy link
Member

@bjorn3 bjorn3 left a comment

Choose a reason for hiding this comment

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

r=me when CI passes

View changes since this review

@bjorn3
Copy link
Member

bjorn3 commented Nov 5, 2025

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Nov 5, 2025

📌 Commit 71e2e0c has been approved by bjorn3

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 Nov 5, 2025
Zalathar added a commit to Zalathar/rust that referenced this pull request Nov 6, 2025
Minor fixes to StdNonZeroNumberProvider for gdb

While looking at the pretty-printers, I found a few minor oddities in StdNonZeroNumberProvider.

First, gdb.Type.fields() already returns a sequence, so there's no need to call list().

Second, it's more idiomatic for the (somewhat misnamed) to_string method to simply return the underlying gdb.Value.  This also lets gdb apply whatever formats were passed to `print`, as the new test shows.

Third, there's no need to use the field's name when looking up a field in a value, the gdb.Field itself can be used.
bors added a commit that referenced this pull request Nov 6, 2025
Rollup of 7 pull requests

Successful merges:

 - #145656 (Stabilize s390x `vector` target feature and `is_s390x_feature_detected!` macro)
 - #147043 (Add default sanitizers to TargetOptions)
 - #147803 (Add -Zannotate-moves for profiler visibility of move/copy operations (codegen))
 - #147912 ([rustdoc] Gracefully handle error in case we cannot run the compiler in doctests)
 - #148540 (Minor fixes to StdNonZeroNumberProvider for gdb)
 - #148541 (Add num_children method to some gdb pretty-printers)
 - #148549 (Fix broken qemu-cskyv2 link)

Failed merges:

 - #147586 (std-detect: improve detect macro docs)

r? `@ghost`
`@rustbot` modify labels: rollup
Zalathar added a commit to Zalathar/rust that referenced this pull request Nov 6, 2025
Minor fixes to StdNonZeroNumberProvider for gdb

While looking at the pretty-printers, I found a few minor oddities in StdNonZeroNumberProvider.

First, gdb.Type.fields() already returns a sequence, so there's no need to call list().

Second, it's more idiomatic for the (somewhat misnamed) to_string method to simply return the underlying gdb.Value.  This also lets gdb apply whatever formats were passed to `print`, as the new test shows.

Third, there's no need to use the field's name when looking up a field in a value, the gdb.Field itself can be used.
bors added a commit that referenced this pull request Nov 6, 2025
Rollup of 7 pull requests

Successful merges:

 - #143037 (Make named asm_labels lint not trigger on hexagon register spans)
 - #147043 (Add default sanitizers to TargetOptions)
 - #147586 (std-detect: improve detect macro docs)
 - #147912 ([rustdoc] Gracefully handle error in case we cannot run the compiler in doctests)
 - #148540 (Minor fixes to StdNonZeroNumberProvider for gdb)
 - #148541 (Add num_children method to some gdb pretty-printers)
 - #148549 (Fix broken qemu-cskyv2 link)

Failed merges:

 - #147935 (Add LLVM realtime sanitizer)

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.

5 participants