diff options
Diffstat (limited to 'src/test/run-pass/trait-inheritance-subst2.rs')
| -rw-r--r-- | src/test/run-pass/trait-inheritance-subst2.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/test/run-pass/trait-inheritance-subst2.rs b/src/test/run-pass/trait-inheritance-subst2.rs index 77e15a802e4..20b7d529fae 100644 --- a/src/test/run-pass/trait-inheritance-subst2.rs +++ b/src/test/run-pass/trait-inheritance-subst2.rs @@ -9,11 +9,11 @@ // except according to those terms. trait Panda<T> { - fn chomp(bamboo: &T) -> T; + fn chomp(&self, bamboo: &T) -> T; } trait Add<RHS,Result>: Panda<RHS> { - fn add(rhs: &RHS) -> Result; + fn add(&self, rhs: &RHS) -> Result; } trait MyNum : Add<Self,Self> { } @@ -21,13 +21,13 @@ trait MyNum : Add<Self,Self> { } struct MyInt { val: int } impl Panda<MyInt> for MyInt { - fn chomp(bamboo: &MyInt) -> MyInt { + fn chomp(&self, bamboo: &MyInt) -> MyInt { mi(self.val + bamboo.val) } } impl Add<MyInt, MyInt> for MyInt { - fn add(other: &MyInt) -> MyInt { self.chomp(other) } + fn add(&self, other: &MyInt) -> MyInt { self.chomp(other) } } impl MyNum for MyInt; |
