]> git.lizzy.rs Git - rust.git/blob - src/test/ui/union/union-derive-eq.rs
Merge commit 'b71f3405606d49b9735606b479c3415a0ca9810f' into clippyup
[rust.git] / src / test / ui / union / union-derive-eq.rs
1 #[derive(Eq)] // OK
2 union U1 {
3     a: u8,
4 }
5
6 impl PartialEq for U1 { fn eq(&self, rhs: &Self) -> bool { true } }
7
8 #[derive(PartialEq, Copy, Clone)]
9 struct PartialEqNotEq;
10
11 #[derive(Eq)]
12 union U2 {
13     a: PartialEqNotEq, //~ ERROR the trait bound `PartialEqNotEq: Eq` is not satisfied
14 }
15
16 impl PartialEq for U2 { fn eq(&self, rhs: &Self) -> bool { true } }
17
18 fn main() {}