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 | |
Graydon Hoare | 89c8ef7 | 2013-02-02 03:43:17 | [diff] [blame] | 11 | pub fn main() { |
Patrick Walton | 5b4d5ce | 2012-08-31 22:10:44 | [diff] [blame] | 12 | enum x { foo } |
Patrick Walton | 9143688 | 2013-02-14 19:47:00 | [diff] [blame] | 13 | impl ::core::cmp::Eq for x { |
Patrick Walton | 3eda11a | 2013-03-22 18:23:21 | [diff] [blame^] | 14 | fn eq(&self, other: &x) -> bool { |
Patrick Walton | 318e534 | 2012-11-15 02:59:30 | [diff] [blame] | 15 | (*self) as int == (*other) as int |
| 16 | } |
Patrick Walton | 3eda11a | 2013-03-22 18:23:21 | [diff] [blame^] | 17 | fn ne(&self, other: &x) -> bool { !(*self).eq(other) } |
Patrick Walton | 5b4d5ce | 2012-08-31 22:10:44 | [diff] [blame] | 18 | } |
| 19 | } |