struct Foo { a: A, } impl Foo { fn bar(self) -> isize { // { dg-error "duplicate definitions with name bar" } self.a } } impl Foo { fn bar(self) -> char { // { dg-error "duplicate definitions with name bar" } self.a } } impl Foo { fn bar(self) -> T { self.a } } fn main() { let a = Foo { a: 123 }; a.bar(); }