1
Fork 0

librustc: Forbid pub or priv before trait implementations

This commit is contained in:
Patrick Walton 2013-02-26 17:12:00 -08:00
parent 573a31dfa7
commit 07c3f5c0de
67 changed files with 304 additions and 288 deletions

View file

@ -17,25 +17,25 @@ pub struct MyInt {
val: int
}
pub impl Add<MyInt, MyInt> for MyInt {
impl Add<MyInt, MyInt> for MyInt {
pure fn add(&self, other: &MyInt) -> MyInt { mi(self.val + other.val) }
}
pub impl Sub<MyInt, MyInt> for MyInt {
impl Sub<MyInt, MyInt> for MyInt {
pure fn sub(&self, other: &MyInt) -> MyInt { mi(self.val - other.val) }
}
pub impl Mul<MyInt, MyInt> for MyInt {
impl Mul<MyInt, MyInt> for MyInt {
pure fn mul(&self, other: &MyInt) -> MyInt { mi(self.val * other.val) }
}
pub impl Eq for MyInt {
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 MyNum for MyInt;
impl MyNum for MyInt;
pure fn mi(v: int) -> MyInt { MyInt { val: v } }