Skip to content

Conversation

@ada4a
Copy link
Contributor

@ada4a ada4a commented Oct 24, 2025

Fixes #15942

changelog: [use_debug]: don't get confused by nested Debug impls

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Oct 24, 2025
@rustbot
Copy link
Collaborator

rustbot commented Oct 24, 2025

r? @y21

rustbot has assigned @y21.
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

@ada4a ada4a changed the title fix(use_debug): don't get confused in nested Debug impls fix(use_debug): don't get confused by nested Debug impls Oct 24, 2025
pub struct Write {
format_args: FormatArgsStorage,
in_debug_impl: bool,
debug_impl_depth: u8, // surely nobody will go 256+ `impl Debug`s deep
Copy link
Contributor

Choose a reason for hiding this comment

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

We usually use u32 for a counter like this unless there's a very good reason. In this case there isn't even a benefit since the struct has enough padding to fit a u32 counter anyways.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Check that in_debug_impl pattern is sound

4 participants