Add a regression test for issue-81712
This commit is contained in:
parent
6f7673d077
commit
0ae72509a7
@ -0,0 +1,21 @@
|
||||
// Regression test for #81712.
|
||||
|
||||
#![feature(generic_associated_types)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
trait A {
|
||||
type BType: B<AType = Self>;
|
||||
}
|
||||
|
||||
trait B {
|
||||
type AType: A<BType = Self>;
|
||||
}
|
||||
trait C {
|
||||
type DType<T>: D<T, CType = Self>;
|
||||
//~^ ERROR: missing generics for associated type `C::DType` [E0107]
|
||||
}
|
||||
trait D<T> {
|
||||
type CType: C<DType = Self>;
|
||||
}
|
||||
|
||||
fn main() {}
|
@ -0,0 +1,19 @@
|
||||
error[E0107]: missing generics for associated type `C::DType`
|
||||
--> $DIR/issue-81712-cyclic-traits.rs:14:10
|
||||
|
|
||||
LL | type DType<T>: D<T, CType = Self>;
|
||||
| ^^^^^ expected 1 type argument
|
||||
|
|
||||
note: associated type defined here, with 1 type parameter: `T`
|
||||
--> $DIR/issue-81712-cyclic-traits.rs:14:10
|
||||
|
|
||||
LL | type DType<T>: D<T, CType = Self>;
|
||||
| ^^^^^ -
|
||||
help: use angle brackets to add missing type argument
|
||||
|
|
||||
LL | type DType<T><T>: D<T, CType = Self>;
|
||||
| ^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0107`.
|
Loading…
Reference in New Issue
Block a user