gcc/testsuite/rust/compile/torture/traits5.rs
raw| 1 | #[lang = "sized"] |
| 2 | pub trait Sized {} |
| 3 | |
| 4 | trait Foo { |
| 5 | type A; |
| 6 | type B; |
| 7 | |
| 8 | fn new(a: Self::A, b: Self::B) -> Self; |
| 9 | } |
| 10 | |
| 11 | struct Baz(i32, f32); |
| 12 | |
| 13 | impl Foo for Baz { |
| 14 | type A = i32; |
| 15 | type B = f32; |
| 16 | |
| 17 | fn new(a: i32, b: f32) -> Self { |
| 18 | Baz(a, b) |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | fn main() { |
| 23 | Baz::new(123, 456f32); |
| 24 | } |