Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ExpHP opened this issue Jan 19, 2015 · 0 comments · Fixed by #21404
Closed

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

ExpHP opened this issue Jan 19, 2015 · 0 comments · Fixed by #21404

Comments

@ExpHP
Copy link
Contributor

ExpHP commented Jan 19, 2015

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]`
japaric pushed a commit to japaric/rust that referenced this issue Jan 19, 2015
barosl added a commit to barosl/rust that referenced this issue Jan 20, 2015
closes rust-lang#21402
cc rust-lang#15294

r? @alexcrichton or @aturon 
cc @ExpHP (btw, this only covers arrays with arity up to 32)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants