Graydon Hoare | d1affff | 2012-12-11 01:32:48 | [diff] [blame] | 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. |
| 4 | // |
| 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. |
| 10 | |
Andrew Paseltiner | ec96096 | 2013-03-20 15:42:59 | [diff] [blame] | 11 | #[deriving(Eq)] |
Patrick Walton | a7aecc4 | 2012-11-20 02:05:50 | [diff] [blame] | 12 | enum Foo { |
| 13 | Bar, |
| 14 | Baz, |
| 15 | Boo |
| 16 | } |
| 17 | |
Graydon Hoare | 89c8ef7 | 2013-02-02 03:43:17 | [diff] [blame] | 18 | pub fn main() { |
Patrick Walton | a7aecc4 | 2012-11-20 02:05:50 | [diff] [blame] | 19 | let a = Bar; |
| 20 | let b = Bar; |
Corey Richardson | cc57ca0 | 2013-05-19 02:02:45 | [diff] [blame] | 21 | assert_eq!(a, b); |
Patrick Walton | 1e91595 | 2013-03-29 01:39:09 | [diff] [blame] | 22 | assert!(!(a != b)); |
| 23 | assert!(a.eq(&b)); |
| 24 | assert!(!a.ne(&b)); |
Patrick Walton | a7aecc4 | 2012-11-20 02:05:50 | [diff] [blame] | 25 | } |