Open mcarton opened 3 years ago
The following compiles but shouldn't because Error is only PartialEq and not Eq:
Error
PartialEq
Eq
#[derive(derivative::Derivative)] #[derivative(PartialEq)] struct Error; #[derive(derivative::Derivative)] #[derivative(PartialEq, Eq)] struct Struct { x: Error, } fn main() {}
(Permalink to the playground)
Similarly
#[derive(PartialEq, Eq)] struct Struct { x: f32, }
shouldn't compile.
rustc enforces this using secret methods: https://github.com/rust-lang/rust/issues/13101
The following compiles but shouldn't because
Error
is onlyPartialEq
and notEq
:(Permalink to the playground)
Similarly
shouldn't compile.
rustc enforces this using secret methods: https://github.com/rust-lang/rust/issues/13101