From 318e534895f20e7991abbc644eec311816010ef1 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Wed, 14 Nov 2012 18:59:30 -0800 Subject: rustc: Implement explicit self for Eq and Ord. r=graydon --- src/libsyntax/parse/parser.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/libsyntax/parse/parser.rs') diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 3e8f0840883..0df61a7f044 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -3743,10 +3743,20 @@ impl Parser { } impl restriction : cmp::Eq { + #[cfg(stage0)] pure fn eq(other: &restriction) -> bool { (self as uint) == ((*other) as uint) } + #[cfg(stage1)] + #[cfg(stage2)] + pure fn eq(&self, other: &restriction) -> bool { + ((*self) as uint) == ((*other) as uint) + } + #[cfg(stage0)] pure fn ne(other: &restriction) -> bool { !self.eq(other) } + #[cfg(stage1)] + #[cfg(stage2)] + pure fn ne(&self, other: &restriction) -> bool { !(*self).eq(other) } } // -- cgit 1.4.1-3-g733a5