1 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
13 enum colour { red(isize, isize), green, }
15 impl PartialEq
for colour
{
16 fn eq(&self, other
: &colour
) -> bool
{
18 colour
::red(a0
, b0
) => {
20 colour
::red(a1
, b1
) => a0
== a1
&& b0
== b1
,
21 colour
::green
=> false,
26 colour
::red(..) => false,
32 fn ne(&self, other
: &colour
) -> bool { !(*self).eq(other) }
35 fn f() { let x = colour::red(1, 2); let y = colour::green; assert!((x != y)); }
37 pub fn main() { f(); }