Skip to content

Commit e89276b

Browse files
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`
2 parents 2a5ecb2 + 0ae7250 commit e89276b

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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 numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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`.

0 commit comments

Comments
 (0)