librustc: Implement (and require) explicit self for derivable traits. r=nmatsakis

This commit is contained in:
Patrick Walton 2012-11-14 16:32:37 -08:00
parent 29e10c91fe
commit adc4bed773
13 changed files with 89 additions and 46 deletions

View file

@ -1,6 +1,6 @@
trait MyEq {
#[derivable]
pure fn eq(other: &self) -> bool;
pure fn eq(&self, other: &self) -> bool;
}
struct A {

View file

@ -1,5 +1,5 @@
trait MyEq {
pure fn eq(other: &self) -> bool;
pure fn eq(&self, other: &self) -> bool;
}
struct A {
@ -7,7 +7,7 @@ struct A {
}
impl int : MyEq {
pure fn eq(other: &int) -> bool { self == *other }
pure fn eq(&self, other: &int) -> bool { *self == *other }
}
impl A : MyEq; //~ ERROR missing method