From 9117dcb968f96d0e9391dfac50348d4c031d89b3 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Wed, 19 Sep 2012 18:00:26 -0700 Subject: rustc: De-mode all overloaded operators --- src/libsyntax/ast_map.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/libsyntax/ast_map.rs') 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]; -- cgit 1.4.1-3-g733a5