aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/issue-2037.rs
blob: 8adcb9751098cd808f0a0b12e92ec8db06b5b0ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#[lang = "sized"]
pub trait Sized {}

trait Foo {
    fn bar(&mut self, other: &mut Foo);
}

struct Baz;

impl Foo for Baz {
    fn bar(&mut self, other: &Foo) {}
    // { dg-error "expected" "" { target *-*-* } .-1 }
    // { dg-error "method .bar. has an incompatible type for trait .Foo." "" { target *-*-* } .-2 }
}

fn main() {}