]> git.lizzy.rs Git - rust.git/blob - tests/ui/derive_hash_xor_eq.rs
Auto merge of #4744 - phansch:split_up_some_derive_test, r=flip1995
[rust.git] / tests / ui / derive_hash_xor_eq.rs
1 use std::hash::{Hash, Hasher};
2
3 #[derive(PartialEq, Hash)]
4 struct Foo;
5
6 impl PartialEq<u64> for Foo {
7     fn eq(&self, _: &u64) -> bool {
8         true
9     }
10 }
11
12 #[derive(Hash)]
13 struct Bar;
14
15 impl PartialEq for Bar {
16     fn eq(&self, _: &Bar) -> bool {
17         true
18     }
19 }
20
21 #[derive(Hash)]
22 struct Baz;
23
24 impl PartialEq<Baz> for Baz {
25     fn eq(&self, _: &Baz) -> bool {
26         true
27     }
28 }
29
30 #[derive(PartialEq)]
31 struct Bah;
32
33 impl Hash for Bah {
34     fn hash<H: Hasher>(&self, _: &mut H) {}
35 }
36
37 fn main() {}