aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/traits10.rs
blob: f8f551ba86d7dd79e1771da2ed67150db124aa20 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
struct Foo(i32);

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

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

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