2 fn get(&self, A: &A) { }
9 impl<T> Foo<T> for [isize;0] {
10 // OK, T is used in `Foo<T>`.
13 impl<T,U> Foo<T> for [isize;1] {
14 //~^ ERROR the type parameter `U` is not constrained
17 impl<T,U> Foo<T> for [isize;2] where T : Bar<Out=U> {
18 // OK, `U` is now constrained by the output type parameter.
21 impl<T:Bar<Out=U>,U> Foo<T> for [isize;3] {
22 // OK, same as above but written differently.
25 impl<T,U> Foo<T> for U {
26 // OK, T, U are used everywhere. Note that the coherence check
27 // hasn't executed yet, so no errors about overlap.
31 //~^ ERROR the type parameter `U` is not constrained
35 // Using `U` in an associated type within the impl is not good enough!
41 //~^^^ ERROR the type parameter `U` is not constrained
43 // This crafty self-referential attempt is still no good.
46 impl<T,U,V> Foo<T> for T
47 where (T,U): Bar<Out=V>
49 //~^^^ ERROR the type parameter `U` is not constrained
50 //~| ERROR the type parameter `V` is not constrained
52 // Here, `V` is bound by an output type parameter, but the inputs
53 // are not themselves constrained.
56 impl<T,U,V> Foo<(T,U)> for T
57 where (T,U): Bar<Out=V>
59 // As above, but both T and U ARE constrained.