gcc/testsuite/rust/compile/traits9.rs
raw| 1 | #[lang = "sized"] |
| 2 | pub trait Sized {} |
| 3 | |
| 4 | struct Foo(i32); |
| 5 | trait Bar { |
| 6 | fn baz(&self); |
| 7 | } |
| 8 | |
| 9 | fn main() { |
| 10 | let a; |
| 11 | a = Foo(123); |
| 12 | |
| 13 | let b: &dyn Bar = &a; |
| 14 | // { dg-error "bounds not satisfied for Foo .Bar. is not satisfied" "" { target *-*-* } .-1 } |
| 15 | // { dg-error "expected" "" { target *-*-* } .-2 } |
| 16 | } |