Skip to content

MutexGuard's Debug implementation is unuseful #57702

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.

Activity

  1. added
    T-libs-api[DEPRECATED; DO NOT USE]
    C-enhancementCategory: An issue proposing an enhancement or a PR with one.
    on Jan 17, 2019
  2. added 3 commits that reference this issue on Jan 26, 2019
    d638b30
    64eff91
    1e8fde0
  3. added a commit that references this issue on Mar 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: An issue proposing an enhancement or a PR with one.T-libs-api[DEPRECATED; DO NOT USE]

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions