diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2012-11-14 18:59:30 -0800 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2012-11-19 15:33:11 -0800 |
| commit | 318e534895f20e7991abbc644eec311816010ef1 (patch) | |
| tree | 764ce1ae3e9efbecd4fdc057663beb522b10bda9 /src/libsyntax/ext | |
| parent | 4101587a88d719659d2e30feaad8437c55af9150 (diff) | |
rustc: Implement explicit self for Eq and Ord. r=graydon
Diffstat (limited to 'src/libsyntax/ext')
| -rw-r--r-- | src/libsyntax/ext/pipes/proto.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/libsyntax/ext/pipes/proto.rs b/src/libsyntax/ext/pipes/proto.rs index 229e55fdfcc..23e18478536 100644 --- a/src/libsyntax/ext/pipes/proto.rs +++ b/src/libsyntax/ext/pipes/proto.rs @@ -6,6 +6,7 @@ use ast_builder::{path, append_types}; enum direction { send, recv } impl direction : cmp::Eq { + #[cfg(stage0)] pure fn eq(other: &direction) -> bool { match (self, (*other)) { (send, send) => true, @@ -14,7 +15,21 @@ impl direction : cmp::Eq { (recv, _) => false, } } + #[cfg(stage1)] + #[cfg(stage2)] + pure fn eq(&self, other: &direction) -> bool { + match ((*self), (*other)) { + (send, send) => true, + (recv, recv) => true, + (send, _) => false, + (recv, _) => false, + } + } + #[cfg(stage0)] pure fn ne(other: &direction) -> bool { !self.eq(other) } + #[cfg(stage1)] + #[cfg(stage2)] + pure fn ne(&self, other: &direction) -> bool { !(*self).eq(other) } } impl direction: ToStr { |
