diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2012-09-19 18:00:26 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2012-09-20 09:48:05 -0700 |
| commit | 9117dcb968f96d0e9391dfac50348d4c031d89b3 (patch) | |
| tree | a571f0c2ef1f91370cae51527f0e0761212a82e7 /src/libsyntax/ext | |
| parent | 6b670c306b8de545afcbcea81bcd592c644409d7 (diff) | |
| download | rust-9117dcb968f96d0e9391dfac50348d4c031d89b3.tar.gz rust-9117dcb968f96d0e9391dfac50348d4c031d89b3.zip | |
rustc: De-mode all overloaded operators
Diffstat (limited to 'src/libsyntax/ext')
| -rw-r--r-- | src/libsyntax/ext/pipes/proto.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/libsyntax/ext/pipes/proto.rs b/src/libsyntax/ext/pipes/proto.rs index fec8339cf1a..9656a63cb0b 100644 --- a/src/libsyntax/ext/pipes/proto.rs +++ b/src/libsyntax/ext/pipes/proto.rs @@ -5,6 +5,7 @@ use ast_builder::{path, append_types}; enum direction { send, recv } +#[cfg(stage0)] impl direction : cmp::Eq { pure fn eq(&&other: direction) -> bool { match (self, other) { @@ -16,6 +17,19 @@ impl direction : cmp::Eq { } pure fn ne(&&other: direction) -> bool { !self.eq(other) } } +#[cfg(stage1)] +#[cfg(stage2)] +impl direction : cmp::Eq { + pure fn eq(other: &direction) -> bool { + match (self, (*other)) { + (send, send) => true, + (recv, recv) => true, + (send, _) => false, + (recv, _) => false, + } + } + pure fn ne(other: &direction) -> bool { !self.eq(other) } +} impl direction: ToStr { fn to_str() -> ~str { |
