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

trait Foo {
    type A;
    type B;

    fn new(a: Self::A, b: Self::B) -> Self;
}

struct Baz(i32, f32);

impl Foo for Baz {
    type A = i32;
    type B = f32;

    fn new(a: i32, b: f32) -> Self {
        Baz(a, b)
    }
}

fn main() {
    Baz::new(123, 456f32);
}