]> git.lizzy.rs Git - rust.git/blob - src/test/ui/union/union-derive-eq.rs
Auto merge of #94066 - Mark-Simulacrum:factor-out-simple-def-kind, r=davidtwco
[rust.git] / src / test / ui / union / union-derive-eq.rs
1 // revisions: mirunsafeck thirunsafeck
2 // [thirunsafeck]compile-flags: -Z thir-unsafeck
3
4 #[derive(Eq)] // OK
5 union U1 {
6     a: u8,
7 }
8
9 impl PartialEq for U1 { fn eq(&self, rhs: &Self) -> bool { true } }
10
11 #[derive(PartialEq, Copy, Clone)]
12 struct PartialEqNotEq;
13
14 #[derive(Eq)]
15 union U2 {
16     a: PartialEqNotEq, //~ ERROR the trait bound `PartialEqNotEq: Eq` is not satisfied
17 }
18
19 impl PartialEq for U2 { fn eq(&self, rhs: &Self) -> bool { true } }
20
21 fn main() {}