Debian Codegraph @

gcc/testsuite/rust/compile/derive-eq-invalid.rs

raw
1 mod core {
2 mod cmp {
3 #[lang = "eq"]
4 pub trait PartialEq<Rhs: ?Sized = Self> {
5 fn eq(&self, other: &Rhs) -> bool;
6
7 fn ne(&self, other: &Rhs) -> bool {
8 !self.eq(other)
9 }
10 }
11
12 pub trait Eq: PartialEq<Self> {
13 fn assert_receiver_is_total_eq(&self) {}
14 }
15 }
16 }
17
18 #[lang = "phantom_data"]
19 struct PhantomData<T>;
20
21 #[lang = "sized"]
22 trait Sized {}
23
24 #[lang = "structural_peq"]
25 trait StructuralPartialEq {}
26
27 #[lang = "structural_teq"]
28 trait StructuralEq {}
29
30 #[derive(PartialEq)]
31 struct NotEq;
32
33 #[derive(Eq, PartialEq)] // { dg-error "bounds not satisfied for NotEq .Eq." }
34 struct Container(NotEq);
35
36 // #[derive(Eq)]
37 // struct Foo { a: i32 }
38 // #[derive(Eq)]
39 // struct Bar(i32);
40
41 // #[derive(Eq)]
42 // enum Baz {
43 // A,
44 // B(i32),
45 // C { a: i32 }
46 // }
47
48 // #[derive(Eq)]
49 // union Qux {
50 // a: i32,
51 // b: i64,
52 // }