about summary refs log tree commit diff
path: root/src/libsyntax/ast_map.rs
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2012-09-19 18:00:26 -0700
committerPatrick Walton <pcwalton@mimiga.net>2012-09-20 09:48:05 -0700
commit9117dcb968f96d0e9391dfac50348d4c031d89b3 (patch)
treea571f0c2ef1f91370cae51527f0e0761212a82e7 /src/libsyntax/ast_map.rs
parent6b670c306b8de545afcbcea81bcd592c644409d7 (diff)
rustc: De-mode all overloaded operators
Diffstat (limited to 'src/libsyntax/ast_map.rs')
-rw-r--r--src/libsyntax/ast_map.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/libsyntax/ast_map.rs b/src/libsyntax/ast_map.rs
index d813c7e4b08..3257e54626b 100644
--- a/src/libsyntax/ast_map.rs
+++ b/src/libsyntax/ast_map.rs
@@ -11,6 +11,7 @@ enum path_elt {
     path_name(ident)
 }
 
+#[cfg(stage0)]
 impl path_elt : cmp::Eq {
     pure fn eq(&&other: path_elt) -> bool {
         match self {
@@ -30,6 +31,27 @@ impl path_elt : cmp::Eq {
     }
     pure fn ne(&&other: path_elt) -> bool { !self.eq(other) }
 }
+#[cfg(stage1)]
+#[cfg(stage2)]
+impl path_elt : cmp::Eq {
+    pure fn eq(other: &path_elt) -> bool {
+        match self {
+            path_mod(e0a) => {
+                match (*other) {
+                    path_mod(e0b) => e0a == e0b,
+                    _ => false
+                }
+            }
+            path_name(e0a) => {
+                match (*other) {
+                    path_name(e0b) => e0a == e0b,
+                    _ => false
+                }
+            }
+        }
+    }
+    pure fn ne(other: &path_elt) -> bool { !self.eq(other) }
+}
 
 type path = ~[path_elt];