2012-11-13 21:08:01 -06:00
|
|
|
trait MyEq {
|
2012-11-14 18:32:37 -06:00
|
|
|
pure fn eq(&self, other: &self) -> bool;
|
2012-11-13 21:08:01 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
struct A {
|
|
|
|
x: int
|
|
|
|
}
|
|
|
|
|
|
|
|
impl int : MyEq {
|
2012-11-14 18:32:37 -06:00
|
|
|
pure fn eq(&self, other: &int) -> bool { *self == *other }
|
2012-11-13 21:08:01 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
impl A : MyEq; //~ ERROR missing method
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
}
|
|
|
|
|