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