1 // Check projection of an associated type out of a higher-ranked trait-bound
2 // in the context of a struct definition.
7 fn get(&self, t: T) -> Self::A;
10 struct SomeStruct<I: for<'x> Foo<&'x isize>> {
12 //~^ ERROR cannot extract an associated type from a higher-ranked trait bound in this context
15 enum SomeEnum<'b, I: for<'a> Foo<&'a isize>> {
17 //~^ ERROR cannot extract an associated type from a higher-ranked trait bound in this context
18 StructVariant { field: I::A },
19 //~^ ERROR cannot extract an associated type from a higher-ranked trait bound in this context
23 // FIXME(eddyb) This one doesn't even compile because of the unsupported syntax.
25 // struct AnotherStruct<I : for<'x> Foo<&'x isize>> {
26 // field: <I as for<'y> Foo<&'y isize>>::A
29 struct YetAnotherStruct<'a, I: for<'x> Foo<&'x isize>> {
30 field: <I as Foo<&'a isize>>::A,
33 struct Why<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'n, 'o, 'p, 'q, 'r, 's, 't, 'u, 'v, 'w, 'x,
34 'y, 'z, 'aa, I: for<'l, 'm> Foo<&'l &'m isize>> {
36 //~^ ERROR cannot extract an associated type from a higher-ranked trait bound in this context