mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 09:14:20 +00:00
15 lines
340 B
Rust
15 lines
340 B
Rust
// run-pass
|
|
#![allow(dead_code)]
|
|
#![allow(non_camel_case_types)]
|
|
|
|
pub fn main() {
|
|
#[derive(Copy, Clone)]
|
|
enum x { foo }
|
|
impl ::std::cmp::PartialEq for x {
|
|
fn eq(&self, other: &x) -> bool {
|
|
(*self) as isize == (*other) as isize
|
|
}
|
|
fn ne(&self, other: &x) -> bool { !(*self).eq(other) }
|
|
}
|
|
}
|