diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2021-03-04 21:56:34 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-04 21:56:34 +0100 |
| commit | e89276baba21a178399dc47d9d6de7a17fc7798d (patch) | |
| tree | 25d22146d9de7533bd003373a79413f0ae3a247e | |
| parent | 2a5ecb29277d1d951039803b652b5b4645250814 (diff) | |
| parent | 0ae72509a71fed8e63fac06b629338bc00d7c9e2 (diff) | |
| download | rust-e89276baba21a178399dc47d9d6de7a17fc7798d.tar.gz rust-e89276baba21a178399dc47d9d6de7a17fc7798d.zip | |
Rollup merge of #82752 - JohnTitor:gat-ice-test, r=jackh726
Add a regression test for issue-81712 Fixes #81712, also fixes #79768 as duplicate. r? `@jackh726`
| -rw-r--r-- | src/test/ui/generic-associated-types/issue-81712-cyclic-traits.rs | 21 | ||||
| -rw-r--r-- | src/test/ui/generic-associated-types/issue-81712-cyclic-traits.stderr | 19 |
2 files changed, 40 insertions, 0 deletions
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 00000000000..934870afc11 --- /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<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() {} 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 00000000000..75f68cd3148 --- /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<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`. |
