Debian Codegraph @

gcc/testsuite/rust/compile/traits10.rs

raw
1 #[lang = "sized"]
2 pub trait Sized {}
3
4 struct Foo(i32);
5
6 trait Bar {
7 const A: i32 = 123;
8 fn B();
9 fn C(&self);
10 }
11
12 pub fn main() {
13 let a;
14 a = Foo(123);
15
16 let b: &dyn Bar = &a;
17 // { dg-error "trait bound is not object safe" "" { target *-*-* } .-1 }
18 }