2 #![allow(unused_parens)]
3 #![allow(non_camel_case_types)]
6 enum colour { red(isize, isize), green, }
8 impl PartialEq
for colour
{
9 fn eq(&self, other
: &colour
) -> bool
{
11 colour
::red(a0
, b0
) => {
13 colour
::red(a1
, b1
) => a0
== a1
&& b0
== b1
,
14 colour
::green
=> false,
19 colour
::red(..) => false,
25 fn ne(&self, other
: &colour
) -> bool { !(*self).eq(other) }
28 fn f() { let x = colour::red(1, 2); let y = colour::green; assert!((x != y)); }
30 pub fn main() { f(); }