File tree 2 files changed +40
-0
lines changed
src/test/ui/generic-associated-types
2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change
1
+ // Regression test for #81712.
2
+
3
+ #![ feature( generic_associated_types) ]
4
+ #![ allow( incomplete_features) ]
5
+
6
+ trait A {
7
+ type BType : B < AType = Self > ;
8
+ }
9
+
10
+ trait B {
11
+ type AType : A < BType = Self > ;
12
+ }
13
+ trait C {
14
+ type DType < T > : D < T , CType = Self > ;
15
+ //~^ ERROR: missing generics for associated type `C::DType` [E0107]
16
+ }
17
+ trait D < T > {
18
+ type CType : C < DType = Self > ;
19
+ }
20
+
21
+ fn main ( ) { }
Original file line number Diff line number Diff line change
1
+ error[E0107]: missing generics for associated type `C::DType`
2
+ --> $DIR/issue-81712-cyclic-traits.rs:14:10
3
+ |
4
+ LL | type DType<T>: D<T, CType = Self>;
5
+ | ^^^^^ expected 1 type argument
6
+ |
7
+ note: associated type defined here, with 1 type parameter: `T`
8
+ --> $DIR/issue-81712-cyclic-traits.rs:14:10
9
+ |
10
+ LL | type DType<T>: D<T, CType = Self>;
11
+ | ^^^^^ -
12
+ help: use angle brackets to add missing type argument
13
+ |
14
+ LL | type DType<T><T>: D<T, CType = Self>;
15
+ | ^^^
16
+
17
+ error: aborting due to previous error
18
+
19
+ For more information about this error, try `rustc --explain E0107`.
You can’t perform that action at this time.
0 commit comments