Skip to content

Debug impl for HashMap::keys should not require values to be Debug #41924

Closed
@jonhoo

Description

@jonhoo

#39002 landed Debug implementations for a number of derived types in collections, but imposes overly strict requirements. For example, for std::collections::hash_map::Keys:

impl<'a, K: Debug, V: Debug> Debug for Keys<'a, K, V> { /* ... */ }

Given that only the keys are printed, we should only require K: Debug, not also V: Debug (unless I'm mistaken?).

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.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