Skip to content

Debug and Display of SocketAddrV6 omit flowinfo #148546

@xSetech

Description

@xSetech

As noted in a recent blog post by @sunshowers,

For most types in Rust, the Debug representation breaks out all the fields and their values. But for SocketAddrV6, the Debug implementation (quite reasonably) forwards to the Display implementation. So the flowinfo field is completely hidden, and the only way to look at it is through the flowinfo method.

This is also not the first time someone has been surprised by a lack of roundtrip serialization of this structure due to this field, see #77205.

It seems reasonable to preserve the Display implementation for this type, as it follows an RFC, but also to differentiate Debug to expose the flowinfo field.

If Debug were changed for this type, what should be the new string format?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-fmtArea: `core::fmt`T-libsRelevant to the library team, which will review and decide on the PR/issue.needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions