aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/traits12.rs
blob: 25e0eb7aaa3cd307f6d11e271729f595afc83ec6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
trait A<T> {
    type Output;

    fn test(self, a: &T) -> &Self::Output;
}

struct Foo<T> {
    start: T,
    end: T,
}

impl<T> A for Foo<usize> {
    // { dg-error "generic item takes at least 1 type arguments but 0 were supplied" "" { target *-*-* } .-1 }
    // { dg-error "unconstrained type parameter" "" { target *-*-* } .-2 }
    type Output = T;

    fn test(self, a: &T) -> &Self::Output {
        a
    }
}