aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/generics10.rs
blob: c66a08f7e169edbd6051ca89c04bdf862777410b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
struct Foo<A, B>(A, B);

impl<X = i32> Foo<X, f32> { // { dg-error "defaults for type parameters are only allowed in .struct., .enum., .type., or .trait. definitions" }
    fn new(a: X, b: f32) -> Self {
        Self(a, b)
    }
}

fn main() {
    let a;
    a = Foo::new(123, 456f32);
}