1 An attempt was made to retrieve an associated type, but the type was ambiguous.
5 trait MyTrait {type X; }
12 The problem here is that we're attempting to take the type of X from MyTrait.
13 Unfortunately, the type of X is not defined, because it's only made concrete in
14 implementations of the trait. A working version of this code might look like:
17 trait MyTrait {type X; }
20 impl MyTrait for MyStruct {
25 let foo: <MyStruct as MyTrait>::X;
29 This syntax specifies that we want the X type from MyTrait, as made concrete in
30 MyStruct. The reason that we cannot simply use `MyStruct::X` is that MyStruct
31 might implement two different traits with identically-named associated types.
32 This syntax allows disambiguation between the two.