]> git.lizzy.rs Git - rust.git/blob - src/test/run-pass/empty-tag.rs
rustc: Implement explicit self for Eq and Ord. r=graydon
[rust.git] / src / test / run-pass / empty-tag.rs
1 enum chan { chan_t, }
2
3 impl chan : cmp::Eq {
4     pure fn eq(&self, other: &chan) -> bool {
5         ((*self) as uint) == ((*other) as uint)
6     }
7     pure fn ne(&self, other: &chan) -> bool { !(*self).eq(other) }
8 }
9
10 fn wrapper3(i: chan) {
11     assert i == chan_t;
12 }
13
14 fn main() {
15     let wrapped = {||wrapper3(chan_t)};
16     wrapped();
17 }