8000 MutexGuard's Debug implementation is unuseful · Issue #57702 · rust-lang/rust · GitHub
[go: up one dir, main page]

Skip to content
MutexGuard's Debug implementation is unuseful #57702
@m-ou-se

Description

@m-ou-se

MutexGuard's Debug implementation just forwards to the Mutex's Debug implementation, which will simply print <locked>, because the Mutex was locked (by that very same MutexGuard).

Effectively, this means that the current Debug implementation of MutexGuard is equivalent to:

f.write_str("MutexGuard { lock: Mutex { data: <locked> } }")

Instead, it should not try to lock the mutex, but use its own Deref implementation to print the contents of the mutex.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: An issue proposing an enhancement or a PR with one.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0