1
Fork 0

librustc: Stop parsing impl Type : Trait and fix several declarations that slipped through. r=tjc

This commit is contained in:
Patrick Walton 2013-02-14 21:17:26 -08:00
parent 566bcf2225
commit bb833ca0f0
82 changed files with 327 additions and 424 deletions

View file

@ -17,25 +17,25 @@ pub struct MyInt {
val: int
}
pub impl MyInt : Add<MyInt, MyInt> {
pub impl Add<MyInt, MyInt> for MyInt {
pure fn add(&self, other: &MyInt) -> MyInt { mi(self.val + other.val) }
}
pub impl MyInt : Sub<MyInt, MyInt> {
pub impl Sub<MyInt, MyInt> for MyInt {
pure fn sub(&self, other: &MyInt) -> MyInt { mi(self.val - other.val) }
}
pub impl MyInt : Mul<MyInt, MyInt> {
pub impl Mul<MyInt, MyInt> for MyInt {
pure fn mul(&self, other: &MyInt) -> MyInt { mi(self.val * other.val) }
}
pub impl MyInt : Eq {
pub impl Eq for MyInt {
pure fn eq(&self, other: &MyInt) -> bool { self.val == other.val }
pure fn ne(&self, other: &MyInt) -> bool { !self.eq(other) }
}
pub impl MyInt : MyNum;
pub impl MyNum for MyInt;
pure fn mi(v: int) -> MyInt { MyInt { val: v } }