]>
Commit | Line | Data |
---|---|---|
136023e0 XL |
1 | // revisions: mirunsafeck thirunsafeck |
2 | // [thirunsafeck]compile-flags: -Z thir-unsafeck | |
3 | ||
9e0c209e SL |
4 | #[derive(Eq)] // OK |
5 | union U1 { | |
6 | a: u8, | |
a7813a04 | 7 | } |
223e47cc | 8 | |
9e0c209e | 9 | impl PartialEq for U1 { fn eq(&self, rhs: &Self) -> bool { true } } |
223e47cc | 10 | |
29967ef6 | 11 | #[derive(PartialEq, Copy, Clone)] |
9e0c209e | 12 | struct PartialEqNotEq; |
a7813a04 | 13 | |
9e0c209e SL |
14 | #[derive(Eq)] |
15 | union U2 { | |
1b1a35ee | 16 | a: PartialEqNotEq, //~ ERROR the trait bound `PartialEqNotEq: Eq` is not satisfied |
223e47cc | 17 | } |
9e0c209e SL |
18 | |
19 | impl PartialEq for U2 { fn eq(&self, rhs: &Self) -> bool { true } } | |
20 | ||
21 | fn main() {} |