trait Foo { fn f(&self, x: &T); } trait Bar : Foo { fn g(&self); } struct S { x: int } impl S : Foo { fn f(&self, x: &S) { io::println(x.x.to_str()); } } impl S : Bar { fn g(&self) { self.f(self); } } fn main() { let s = S { x: 1 }; s.g(); }