1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
trait MyEq { fn eq(&self, other: &Self) -> bool; } struct A { x: isize } impl MyEq for isize { fn eq(&self, other: &isize) -> bool { *self == *other } } impl MyEq for A {} //~ ERROR not all trait items implemented, missing: `eq` fn main() { }