]> git.proxmox.com Git - rustc.git/blame - src/test/ui/union/union-derive-eq.rs
New upstream version 1.49.0~beta.4+dfsg1
[rustc.git] / src / test / ui / union / union-derive-eq.rs
CommitLineData
9e0c209e
SL
1#[derive(Eq)] // OK
2union U1 {
3 a: u8,
a7813a04 4}
223e47cc 5
9e0c209e 6impl PartialEq for U1 { fn eq(&self, rhs: &Self) -> bool { true } }
223e47cc 7
29967ef6 8#[derive(PartialEq, Copy, Clone)]
9e0c209e 9struct PartialEqNotEq;
a7813a04 10
9e0c209e
SL
11#[derive(Eq)]
12union U2 {
1b1a35ee 13 a: PartialEqNotEq, //~ ERROR the trait bound `PartialEqNotEq: Eq` is not satisfied
223e47cc 14}
9e0c209e
SL
15
16impl PartialEq for U2 { fn eq(&self, rhs: &Self) -> bool { true } }
17
18fn main() {}