test: Remove pure
from the test suite
This commit is contained in:
parent
fbe22afdbe
commit
3eda11a4f7
62 changed files with 153 additions and 158 deletions
|
@ -15,20 +15,20 @@ trait MyNum : Add<Self,Self> + Sub<Self,Self> + Mul<Self,Self> + Eq { }
|
|||
struct MyInt { val: int }
|
||||
|
||||
impl Add<MyInt, MyInt> for MyInt {
|
||||
pure fn add(&self, other: &MyInt) -> MyInt { mi(self.val + other.val) }
|
||||
fn add(&self, other: &MyInt) -> MyInt { mi(self.val + other.val) }
|
||||
}
|
||||
|
||||
impl Sub<MyInt, MyInt> for MyInt {
|
||||
pure fn sub(&self, other: &MyInt) -> MyInt { mi(self.val - other.val) }
|
||||
fn sub(&self, other: &MyInt) -> MyInt { mi(self.val - other.val) }
|
||||
}
|
||||
|
||||
impl Mul<MyInt, MyInt> for MyInt {
|
||||
pure fn mul(&self, other: &MyInt) -> MyInt { mi(self.val * other.val) }
|
||||
fn mul(&self, other: &MyInt) -> MyInt { mi(self.val * other.val) }
|
||||
}
|
||||
|
||||
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) }
|
||||
fn eq(&self, other: &MyInt) -> bool { self.val == other.val }
|
||||
fn ne(&self, other: &MyInt) -> bool { !self.eq(other) }
|
||||
}
|
||||
|
||||
impl MyNum for MyInt;
|
||||
|
@ -37,7 +37,7 @@ fn f<T:Copy + MyNum>(x: T, y: T) -> (T, T, T) {
|
|||
return (x + y, x - y, x * y);
|
||||
}
|
||||
|
||||
pure fn mi(v: int) -> MyInt { MyInt { val: v } }
|
||||
fn mi(v: int) -> MyInt { MyInt { val: v } }
|
||||
|
||||
pub fn main() {
|
||||
let (x, y) = (mi(3), mi(5));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue