about summary refs log tree commit diff
path: root/src/libsyntax/ext
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2012-11-14 18:59:30 -0800
committerPatrick Walton <pcwalton@mimiga.net>2012-11-19 15:33:11 -0800
commit318e534895f20e7991abbc644eec311816010ef1 (patch)
tree764ce1ae3e9efbecd4fdc057663beb522b10bda9 /src/libsyntax/ext
parent4101587a88d719659d2e30feaad8437c55af9150 (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.rs15
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 {