librustc: Implement (and require) explicit self for derivable traits. r=nmatsakis
This commit is contained in:
parent
29e10c91fe
commit
adc4bed773
13 changed files with 89 additions and 46 deletions
|
|
@ -1,6 +1,6 @@
|
|||
trait MyEq {
|
||||
#[derivable]
|
||||
pure fn eq(other: &self) -> bool;
|
||||
pure fn eq(&self, other: &self) -> bool;
|
||||
}
|
||||
|
||||
struct A {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue