mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-11 08:05:12 +00:00
982b49494e
This is to make the diff when stabilizing it easier to review.
19 lines
369 B
Rust
19 lines
369 B
Rust
#[derive(Eq)] // OK
|
|
union U1 {
|
|
a: u8,
|
|
}
|
|
|
|
impl PartialEq for U1 { fn eq(&self, rhs: &Self) -> bool { true } }
|
|
|
|
#[derive(PartialEq, Copy, Clone)]
|
|
struct PartialEqNotEq;
|
|
|
|
#[derive(Eq)]
|
|
union U2 {
|
|
a: PartialEqNotEq, //~ ERROR the trait bound `PartialEqNotEq: Eq` is not satisfied
|
|
}
|
|
|
|
impl PartialEq for U2 { fn eq(&self, rhs: &Self) -> bool { true } }
|
|
|
|
fn main() {}
|