From ded95d2c2891d7ffec1277cb4969ed956ff0bd25 Mon Sep 17 00:00:00 2001 From: John Clements Date: Fri, 8 Feb 2013 18:50:12 -0800 Subject: deriving_eq for tokens and binops Note that the replaced definition of equality on tokens contains a *huge* shortcut on INTERPOLATED tokens (those that contain ASTs), whereby any two INTERPOLATED tokens are considered equal. This seems like a really broken notion of equality, but it appears that the existing test cases and the compiler don't depend on it. Niko noticed this, BTW. Replace long definition of Eq on tokens and binops w --- src/libsyntax/parse/token.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src/libsyntax') diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index 1f8b04630e2..391e8b04336 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -25,6 +25,7 @@ use std::oldmap::HashMap; #[auto_encode] #[auto_decode] +#[deriving_eq] pub enum binop { PLUS, MINUS, @@ -518,12 +519,6 @@ pub fn reserved_keyword_table() -> HashMap<~str, ()> { words } -impl binop : cmp::Eq { - pure fn eq(&self, other: &binop) -> bool { - ((*self) as uint) == ((*other) as uint) - } - pure fn ne(&self, other: &binop) -> bool { !(*self).eq(other) } -} impl Token : cmp::Eq { pure fn eq(&self, other: &Token) -> bool { -- cgit 1.4.1-3-g733a5