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