gcc/testsuite/rust/compile/issue-925.rs
raw| 1 | #[lang = "sized"] |
| 2 | pub trait Sized {} |
| 3 | |
| 4 | struct S; |
| 5 | trait A { |
| 6 | fn foo(&self); |
| 7 | } |
| 8 | |
| 9 | trait B: A { |
| 10 | fn foo(&self); |
| 11 | } |
| 12 | |
| 13 | impl A for S { |
| 14 | fn foo(&self) {} |
| 15 | } |
| 16 | |
| 17 | impl B for S { |
| 18 | fn foo(&self) {} |
| 19 | } |
| 20 | // E0592 |
| 21 | fn test() { |
| 22 | let a = S; |
| 23 | a.foo(); |
| 24 | // { dg-error "duplicate definitions with name .foo." "" { target *-*-* } .-1 } |
| 25 | } |