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

struct Foo(i32);

trait A {
    const A: i32 = 123;
    fn B();
    fn C(&self);
}

trait B: A {
    fn test(&self);
}

pub fn main() {
    let a;
    a = Foo(123);

    let b: &dyn B = &a;
    // { dg-error "trait bound is not object safe" "" { target *-*-* } .-1 }
}