gcc/testsuite/rust/compile/issue-2037.rs
raw| 1 | #[lang = "sized"] |
| 2 | pub trait Sized {} |
| 3 | |
| 4 | trait Foo { |
| 5 | fn bar(&mut self, other: &mut Foo); |
| 6 | } |
| 7 | |
| 8 | struct Baz; |
| 9 | |
| 10 | impl Foo for Baz { |
| 11 | fn bar(&mut self, other: &Foo) {} |
| 12 | // { dg-error "expected" "" { target *-*-* } .-1 } |
| 13 | // { dg-error "method .bar. has an incompatible type for trait .Foo." "" { target *-*-* } .-2 } |
| 14 | } |
| 15 | |
| 16 | fn main() {} |