rust/tests/ui/coherence/coherence-impl-in-fn.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
340 B
Rust
Raw Normal View History

// run-pass
#![allow(dead_code)]
#![allow(non_camel_case_types)]
pub fn main() {
2015-03-30 08:38:27 -05:00
#[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) }
}
}