rustc: Implement explicit self for Eq and Ord. r=graydon

This commit is contained in:
Patrick Walton 2012-11-14 18:59:30 -08:00
parent 4101587a88
commit 318e534895
89 changed files with 4175 additions and 92 deletions

View file

@ -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) }
}
//