diff --git a/src/test/ui/generic-associated-types/issue-81712-cyclic-traits.rs b/src/test/ui/generic-associated-types/issue-81712-cyclic-traits.rs new file mode 100644 index 0000000000000..934870afc119c --- /dev/null +++ b/src/test/ui/generic-associated-types/issue-81712-cyclic-traits.rs @@ -0,0 +1,21 @@ +// Regression test for #81712. + +#![feature(generic_associated_types)] +#![allow(incomplete_features)] + +trait A { + type BType: B; +} + +trait B { + type AType: A; +} +trait C { + type DType: D; + //~^ ERROR: missing generics for associated type `C::DType` [E0107] +} +trait D { + type CType: C; +} + +fn main() {} diff --git a/src/test/ui/generic-associated-types/issue-81712-cyclic-traits.stderr b/src/test/ui/generic-associated-types/issue-81712-cyclic-traits.stderr new file mode 100644 index 0000000000000..75f68cd314893 --- /dev/null +++ b/src/test/ui/generic-associated-types/issue-81712-cyclic-traits.stderr @@ -0,0 +1,19 @@ +error[E0107]: missing generics for associated type `C::DType` + --> $DIR/issue-81712-cyclic-traits.rs:14:10 + | +LL | type DType: D; + | ^^^^^ 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: D; + | ^^^^^ - +help: use angle brackets to add missing type argument + | +LL | type DType: D; + | ^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0107`.