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

trait Foo {
    fn Bar() -> i32 {}
    // { dg-error "expected .i32. got .()." "" { target *-*-* } .-1 }
}

struct Baz;

impl Foo for Baz {
    fn Bar() {}
    // { dg-error "expected" "" { target *-*-* } .-1 }
    // { dg-error "method .Bar. has an incompatible type for trait .Foo." "" { target *-*-* } .-2 }
}

fn main() {}