Skip to content

Hash is not implemented for array ([T; size]) #21402

@ExpHP

Description

@ExpHP

Perhaps this is more of a wishlist item than anything, but here goes:
While some simple container types implement Hash, fixed-size arrays do not.

#[derive(Hash)]
struct Foo {
    a: Vec<bool>,
    b: (bool, bool),
    c: [bool; 2],
}

error: the trait `core::hash::Hash<__S>` is not implemented for the type `[bool; 2]`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions