forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#82752 - JohnTitor:gat-ice-test, r=jackh726
Add a regression test for issue-81712 Fixes rust-lang#81712, also fixes rust-lang#79768 as duplicate. r? ```@jackh726```
- Loading branch information
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
src/test/ui/generic-associated-types/issue-81712-cyclic-traits.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() {} |
19 changes: 19 additions & 0 deletions
19
src/test/ui/generic-associated-types/issue-81712-cyclic-traits.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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`. |